Skip to main content

One-Command Bootstrap

On a fresh Ubuntu machine or WSL instance, you can bootstrap your entire development environment with a single command:
1

Install curl

First, ensure curl is available on your system:
sudo apt update && sudo apt install -y curl
2

Run the bootstrap script

Download and execute the bootstrap script directly from GitHub:
bash -c "$(curl -fsLS https://raw.githubusercontent.com/yurgenlira/dotfiles/main/bootstrap.sh)"
Do not run this script as root. It will prompt for your password when needed for package installation.
The bootstrap script automatically:
  • Installs all dependencies (ansible, age, bw, chezmoi)
  • Logs you into Bitwarden and unlocks your vault
  • Retrieves (or generates) your age encryption key
  • Prepares your system for dotfiles initialization
3

Initialize and apply dotfiles

Once bootstrap completes, initialize chezmoi with your GitHub username:
chezmoi init --apply yurgenlira
Replace yurgenlira with your own GitHub username to use your fork.
During initialization, you’ll be prompted to answer questions about your environment:
  • Your name
  • Machine type (personal/work/hybrid)
  • Operating system
  • Default editor
  • Email addresses (based on machine type)

What Happens During Bootstrap?

The bootstrap.sh script performs the following operations in order:
# Update package lists
sudo apt-get update
sudo apt-get install -y curl git age gnupg software-properties-common snapd
Installs essential tools needed for the dotfiles system.
# Add Ansible PPA and install
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt-get install -y ansible
Ansible handles system configuration and package management.
# Install via snap (preferred) or npm fallback
sudo snap install bw
Bitwarden CLI manages secrets like SSH keys and AWS credentials.
# Install via snap (preferred) or install script fallback
sudo snap install chezmoi --classic
chezmoi manages your dotfiles with templating and encryption support.
The script logs you into Bitwarden and unlocks your vault:
bw login
BW_SESSION=$(bw unlock --raw)
export BW_SESSION
bw sync
You’ll be prompted for your Bitwarden credentials during this step.
mkdir -p "$HOME/.config/chezmoi"
# Try to retrieve from Bitwarden
bw get notes "chezmoi-age-key" > "$HOME/.config/chezmoi/key.txt"
# Or generate new key if not found
age-keygen -o "$HOME/.config/chezmoi/key.txt"
chmod 600 "$HOME/.config/chezmoi/key.txt"
Retrieves your age encryption key from Bitwarden or generates a new one.
If a new key is generated, you’ll see a message to save it in Bitwarden as a Secure Note named chezmoi-age-key. Do this immediately to avoid losing access to encrypted files.

What Gets Automated?

After running chezmoi init --apply, your system will be fully configured:

System Packages

Base Packages

Essential CLI tools like curl, git, htop, jq, and more

Development Tools

Terraform, docker, build tools, and language runtimes

Desktop Applications

Google Chrome, VS Code, and productivity applications

System Utilities

antigravity, snapd, and system management tools

Configuration Files

  • Shell Environment: ~/.bashrc, ~/.bash_aliases with custom functions
  • Git Config: ~/.gitconfig with conditional work/personal identities
  • SSH Config: ~/.ssh/config (encrypted with age)
  • AWS Credentials: ~/.aws/credentials and ~/.aws/config (from Bitwarden)

GNOME Desktop Settings

  • Dark mode enabled by default
  • Custom clock format (show date, hide seconds)
  • Power management (disable sleep on AC power)

Verify Your Setup

After initialization, verify everything is working:
# Check chezmoi status
chezmoi status

# Verify age key permissions
ls -la ~/.config/chezmoi/key.txt
# Should show: -rw------- (600)

# Check installed packages
which ansible age bw chezmoi

# View applied dotfiles
chezmoi managed

Next Steps

Customize Configuration

Learn how to add packages, modify settings, and customize your environment

Secrets Management

Understand how to manage SSH keys, AWS credentials, and encrypted files

Troubleshooting

Common issues and solutions for bootstrap and initialization

Advanced Usage

Deep dive into chezmoi templates, Ansible customization, and testing

Build docs developers (and LLMs) love