Guide for setting up dotfiles on servers, AI assistants, or automated environments using 1Password Service Accounts.
Server machine type is for:
- AI assistants (like your OpenClaw setup)
- Automation servers (CI/CD runners, cron jobs)
- Headless servers (no GUI, SSH-only access)
- Any environment where you can't interactively log in to 1Password
Server machines use 1Password Service Accounts instead of regular accounts:
| Feature | Regular Account | Service Account |
|---|---|---|
| Login | Interactive (browser/app) | Token-based |
| Authentication | Email + password + 2FA | OP_SERVICE_ACCOUNT_TOKEN |
| Best for | Personal/work laptops | Servers, automation |
| Cost | Free/paid personal | Paid (team/business) |
- 1Password Business/Teams account (Service Accounts require paid plan)
- Service Account created in 1Password
- Token with vault access to the vaults containing your secrets
In 1Password web interface:
- Go to Settings → Service Accounts
- Click Create Service Account
- Name it (e.g., "OpenClaw Server", "AI Assistant")
- Grant access to vaults:
ClawdBotvault (for Claude Code token)Privatevault (for GitHub token)- Any other vaults your dotfiles reference
- Copy the token (starts with
ops_...)⚠️ Save it securely! You can't view it again
Chezmoi will prompt for the token during setup:
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply erix/dotfiles
# Prompts:
Email address: your@email.com
Machine type (home/work/server): server
1Password Service Account Token (ops_...): ops_paste_your_token_hereThe token will be stored securely in ~/.config/chezmoi/chezmoi.toml.
If you prefer to set it beforehand (for automation):
# Set the token before running chezmoi
export OP_SERVICE_ACCOUNT_TOKEN="ops_your_token_here"
# Then bootstrap
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply erix/dotfiles
# When prompted for machine type, select: server
# Token prompt will be skipped if OP_SERVICE_ACCOUNT_TOKEN is already setSecurity Note: For production servers, use a secrets manager (AWS Secrets Manager, Kubernetes secrets, etc.) instead of storing in shell config.
# With token set, run chezmoi
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply erix/dotfiles
# Prompts:
Email address: your@email.com
Machine type (home/work/server): server # ← Select serverCheck that secrets were retrieved:
# Check Claude Code token is set
echo $CLAUDE_CODE_OAUTH_TOKEN | head -c 20 # Should show first 20 chars
# Check GitHub CLI is configured
gh auth statusWhen you select machineType = "server", chezmoi config includes:
[data]
machineType = "server"
isServerMachine = true
[onepassword]
mode = "service-account"This tells chezmoi to:
- Use
OP_SERVICE_ACCOUNT_TOKENfor authentication - Not prompt for interactive 1Password login
- Skip Kubernetes tools installation
Server machines get:
- ✅ All core dev tools and languages
- ✅ Docker and Colima
- ✅ Modern CLI tools
- ❌ No Kubernetes tools (kubectl, k9s)
- ❌ No macOS GUI apps
Install 1Password CLI manually first:
# Linux
curl -sS https://downloads.1password.com/linux/keys/1password.asc | \
sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/$(dpkg --print-architecture) stable main" | \
sudo tee /etc/apt/sources.list.d/1password.list
sudo apt update && sudo apt install 1password-cliCheck your token is valid:
# Test the token
op vault list
# Should show your vaults. If error, token is invalid/expiredVerify your service account has access to the vault:
# List accessible vaults
op vault list
# Try to read the specific secret
op read "op://ClawdBot/Claude Max Token/credential"If not found, add vault access in 1Password web interface.
Make sure the token is exported in your current shell:
# Check it's set
env | grep OP_SERVICE
# If not set, export it
export OP_SERVICE_ACCOUNT_TOKEN="ops_your_token"
# Then re-run
chezmoi applyWhen you rotate tokens or secrets in 1Password:
# Just re-apply dotfiles
chezmoi apply
# Templates will fetch fresh values from 1Password# Store token in shell config
export OP_SERVICE_ACCOUNT_TOKEN="ops_..."# Use systemd environment files
# /etc/systemd/system/myservice.service.d/override.conf
[Service]
EnvironmentFile=/etc/secrets/1password
# /etc/secrets/1password (mode 600, root-only)
OP_SERVICE_ACCOUNT_TOKEN=ops_...# Pass as environment variable
env:
- name: OP_SERVICE_ACCOUNT_TOKEN
valueFrom:
secretKeyRef:
name: onepassword-token
key: tokenFor your AI assistant setup:
# On your Linux server - just run this:
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply erix/dotfiles
# Interactive prompts:
Email address: erik@example.com
Machine type (home/work/server): server
1Password Service Account Token: ops_paste_your_OpenClaw_token_here
# This will:
# - Install all dev tools
# - Configure Claude Code with token from 1Password
# - Configure GitHub CLI with token from 1Password
# - Skip Kubernetes tools
# - Use token-based 1Password (no interactive login)If automating (no interactive prompts):
export OP_SERVICE_ACCOUNT_TOKEN="ops_OpenClaw_token"
chezmoi init --apply erix/dotfiles \
--promptString email=bot@example.com \
--promptString machineType=server