DevOps, Development, Tools, Tutorial
15 min read

Complete macOS Development Environment Setup for SRE/DevOps Engineers

A comprehensive guide to setting up a professional macOS development environment for SRE/DevOps engineers with configuration management for easy migration and team collaboration

macos devops sre development-environment configuration-management git docker kubernetes terraform ansible automation

Introduction

This guide is a synthesis of my personal configuration journey and best practices for SRE/DevOps engineers. It details how to set up a robust, reproducible macOS development environment, covering essential tools, configuration management, and automation strategies. The goal is to make environment setup painless, portable, and scalable—whether you’re starting over, joining a new team, or enabling seamless collaboration.

Prerequisites

Before we begin, ensure you have:

  • macOS 12.0 (Monterey) or later
  • Administrator access to your machine
  • Basic familiarity with command line operations
  • A GitHub account for configuration storage

Core Development Tools

Install required develop tools & Set update/upgrade

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
softwareupdate --all --install --force

1. Homebrew Package Manager

Homebrew is the essential package manager for macOS that will install most of our tools:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Set mirrors for Homebrew/brew and Homebrew/homebrew-core when needed, see: https://developer.aliyun.com/mirror/homebrew.

Add Homebrew to your PATH:

# add to ~/.zshrc

## For Intel Chips
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zshrc
## For Apple M1 ~ Mn Chips
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
source ~/.zshrc

Install useful tools with homebrew:

brew update
brew install \
    pstree \
    tree \
    telnet \
    mtr \
    htop \
    unzip \
    git \
    jq \
    yq \
    fx \
    bat \
    tmux \
    onscripter \
    gpg \
    qemu \
    xattr \
    hugo \
    shellcheck \
    terragrunt \
    httpie \
    tcpdump \
    gnupg \
    openssl@3 \
    nmap
brew install --cask wireshark

2. Git Configuration

Install and configure Git with your identity:

brew install git
brew unlink git && brew link git

# Clone the git template
git clone [email protected]:hanyouqing/git-templates.git ~/github.com/hanyouqing/
ln -s ~/github.com/hanyouqing/git-templates/git/gitconfig ~/.gitconfig

3. OhMyZsh and Shell Customization

Transform your terminal with OhMyZsh:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install essential Oh My Zsh theme and plugins:

# theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/Powerlevel10k
ln -s ~/.oh-my-zsh/custom/themes/Powerlevel10k/powerlevel10k.zsh-theme ~/.oh-my-zsh/themes/Powerlevel10k.zsh-theme
[[ "$(uname -s)" == "Linux" ]]  && echo 'source ~/.oh-my-zsh/custom/themes/Powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc

# plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Setup ohmyzh plugin

cat >> ~/.zshrc <<EOF
# Setup plugins and Powerlevel10k theme for ohmyzsh 
ZSH_THEME="Powerlevel10k" # https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster
ZSH_CUSTOM="\$HOME/.oh-my-zsh/custom"
plugins=(
  git
  macos
  macports
  python
  golang
  docker
  kubectl
  terraform
  ansible
  jsontools
  zsh-completions
  zsh-autosuggestions
  zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh

EOF

Set Powerlevel10k for VSCode When needed.

{
    "terminal.integrated.fontSize": 13,
    "terminal.integrated.fontFamily": "MesloLGS NF"
}

4. Fuzzy Finder (fzf)

Install fzf for powerful command-line fuzzy finding:

brew install fzf

# Install shell integration
$(brew --prefix)/opt/fzf/install

5. iTerm2 Terminal

Install iTerm2 for an enhanced terminal experience:

brew install --cask iterm2
defaults write com.googlecode.iterm2 Command -string "/usr/local/bin/zsh"
defaults write com.googlecode.iterm2 "Terminal Type" "xterm-256color"

6. Visual Studio Code

Install VS Code with essential extensions:

brew install --cask visual-studio-code

Install recommended extensions for DevOps work:

code --install-extension ms-vscode.vscode-json
code --install-extension ms-kubernetes-tools.vscode-kubernetes-tools
code --install-extension hashicorp.terraform
code --install-extension ms-azuretools.vscode-docker
code --install-extension redhat.vscode-yaml
code --install-extension ms-vscode.powershell
code --install-extension bradlc.vscode-tailwindcss
code --install-extension esbenp.prettier-vscode
code --install-extension ms-vscode.vscode-typescript-next

Container and Orchestration Tools

7. Docker Desktop

Install Docker for container development:

brew install --cask docker

8. Kubernetes Tools

Install essential Kubernetes tools:

# kubectl
brew install kubectl

# kubectx and kubens for context switching
brew install kubectx

# k9s for cluster management
brew install k9s

# helm for package management
brew install helm

# kind for local Kubernetes clusters
brew install kind

# minikube for local development
brew install minikube

# Helm
brew install helm

# Kustomize
brew install kustomize

brew install kubeconform

Setup shell for kubectl

mkdir -pv ~/.kube/conf.d/
touch ~/.kube/conf.d/default
cat >> ~/.zshrc <<EOF
# kubectl
export KUBECONFIG=~/.kube/config:\$(ls -d ~/.kube/conf.d/* | paste -sd : -)
source <(kubectl completion zsh)
alias k=kubectl
complete -F __start_kubectl k
# krew
export PATH="\${PATH}:\${HOME}/.krew/bin"
# kustomize
source <(kustomize completion zsh)
# helm
source <(helm completion zsh)
EOF
source ~/.zshrc

Install kubectl plugins

# Setup kubectl alias,autocompletation,plugsin
k krew install ctx
k krew install ns
k krew install images
k krew install explore
k krew install neat
k krew install stern
k krew install tree
k krew install graph
k krew install history
k krew index add awesome-kubectl-plugins https://github.com/ishantanu/awesome-kubectl-plugins.git
k krew install kubectl-rainbow

Install helm plugin

helm plugin install https://github.com/databus23/helm-diff
echo 'source <(helm diff completion zsh)' >> ~/.${SHELL##*bin/}rc
source ~/.${SHELL##*bin/}rc

9. Terraform

Install Terraform for Infrastructure as Code:

brew install terraform

# Install tfenv for version management
brew install tfenv

10. Ansible

Install Ansible for configuration management:

brew install ansible

Additional Essential Tools

11. Python and Node.js

Install Python and Node.js for scripting and development:

# Python with pyenv for version management
brew install pyenv
brew install python

# Node.js with nvm for version management
brew install node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

12. Database Tools

Install database clients for development:

# PostgreSQL client
brew install postgresql

# Redis client
brew install redis

# MongoDB tools
brew install mongodb/brew/mongodb-database-tools

Configuration Management

Creating a Configuration Repository

Create a dedicated repository for your development environment configuration:

mkdir ~/dev-environment-config
cd ~/dev-environment-config
git init

Configuration Files Structure

Organize your configuration files in a logical structure:

dev-environment-config/
├── README.md
├── install.sh
├── configs/
│   ├── git/
│   │   ├── .gitconfig
│   │   └── .gitignore_global
│   ├── zsh/
│   │   └── .zshrc
│   ├── vscode/
│   │   └── settings.json
│   ├── docker/
│   │   └── daemon.json
│   ├── kubernetes/
│   │   └── config
│   └── terraform/
│       └── .terraformrc
├── scripts/
│   ├── setup-brew.sh
│   ├── setup-git.sh
│   ├── setup-shell.sh
│   └── setup-tools.sh
└── requirements.txt

Git Configuration Management

Create a global .gitignore file:

cat > ~/dev-environment-config/configs/git/.gitignore_global << 'EOF'
# macOS
.DS_Store
.AppleDouble
.LSOverride

# IDE
.vscode/
.idea/
*.swp
*.swo

# Logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage/

# Dependency directories
node_modules/
jspm_packages/

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Terraform
*.tfstate
*.tfstate.*
.terraform/
.terraform.lock.hcl

# Kubernetes
*.kubeconfig
kubeconfig

# Docker
.dockerignore
EOF

Shell Configuration

Create a comprehensive .zshrc configuration:

brew install zsh
brew install zsh-completions
echo "/usr/local/bin/zsh" | sudo tee -a /etc/shells
chsh -s /usr/local/bin/zsh

brew install --cask font-meslo-lg-nerd-font

cat > ~/dev-environment-config/configs/zsh/.zshrc << 'EOF'
# Path to your oh-my-zsh installation
export ZSH="$HOME/.oh-my-zsh"

# Theme setting
ZSH_THEME="robbyrussell"

# Plugins
plugins=(
    git
    zsh-autosuggestions
    zsh-syntax-highlighting
    zsh-completions
    docker
    kubectl
    terraform
    ansible
    python
    node
    npm
    brew
    macos
)

source $ZSH/oh-my-zsh.sh

# User configuration
export PATH="/opt/homebrew/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"

# Aliases
alias ll='ls -la'
alias la='ls -A'
alias l='ls -CF'
alias ..='cd ..'
alias github='cd ~/github.com/'
alias work='cd ~/github.com/work'
alias hyq='cd ~/github.com/hanyouqing'

# Environment variables
export EDITOR='code'
export VISUAL='code'
export KUBE_EDITOR='code'

# FZF configuration
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
export FZF_DEFAULT_COMMAND='fd --type f'

# Python virtual environment
export VIRTUAL_ENV_DISABLE_PROMPT=1

# Node version manager
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

# Pyenv configuration
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"

# Completion
autoload -U compinit && compinit
EOF

VS Code Configuration

Create VS Code settings for consistent development experience:

mkdir -p ~/dev-environment-config/configs/vscode
cat > ~/dev-environment-config/configs/vscode/settings.json << 'EOF'
{
    "editor.formatOnSave": true,
    "editor.tabSize": 2,
    "editor.insertSpaces": true,
    "editor.rulers": [80, 100],
    "editor.wordWrap": "on",
    "editor.minimap.enabled": false,
    "files.trimTrailingWhitespace": true,
    "files.insertFinalNewline": true,
    "files.trimFinalNewlines": true,
    "terminal.integrated.fontFamily": "JetBrains Mono",
    "terminal.integrated.fontSize": 14,
    "workbench.colorTheme": "Default Dark+",
    "workbench.iconTheme": "material-icon-theme",
    "git.enableSmartCommit": true,
    "git.confirmSync": false,
    "git.autofetch": true,
    "python.defaultInterpreterPath": "/usr/bin/python3",
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": true,
    "terraform.languageServer.enable": true,
    "yaml.format.enable": true,
    "docker.showStartPage": false,
    "kubernetes.knownKubeconfigs": []
}
EOF

Docker Configuration

Create Docker daemon configuration:

mkdir -p ~/dev-environment-config/configs/docker
cat > ~/dev-environment-config/configs/docker/daemon.json << 'EOF'
{
    "experimental": true,
    "features": {
        "buildkit": true
    },
    "registry-mirrors": [],
    "insecure-registries": [],
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "10m",
        "max-file": "3"
    }
}
EOF

Terraform Configuration

Create Terraform configuration:

# @filepath: ~/.terraformrc
# @requirements:
#     mkdir -pv ~/.terraform.d/plugin-cache
# @reference:
#   https://www.terraform.io/cli/config/config-file
#   https://www.terraform.io/cli/config/config-file#provider-installation
#
# plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"
#      enables plugin caching and specifies, as a string, the location of the plugin cache directory.
#      https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache
#      Alternative: export TF_PLUGIN_CACHE_DIR="$HOME/.terraform.d/plugin-cache"
#
# disable_checkpoint = true
#      when set to true, disables upgrade and security bulletin checks that require reaching out to HashiCorp-provided network services.
#      https://developer.hashicorp.com/terraform/cli/commands#upgrade-and-security-bulletin-checks
#
# disable_checkpoint_signature = true
#      Allows the upgrade and security bulletin checks described above but disables the use of an anonymous id used to de-duplicate warning messages.
#
# provider_installation
#      Customizes the installation methods used by terraform init when installing provider plugins.
#      See https://www.terraform.io/cli/config/config-file#provider-installation
#
# credentials (for Terraform Cloud/Enterprise) 
#     Configures credentials 
#     See https://developer.hashicorp.com/terraform/cli/config/config-file#credentials
#
# credentials_helper (for Terraform Cloud/Enterprise) 
#     Configures an external helper program for the storage and retrieval of credentials
#     See https://developer.hashicorp.com/terraform/cli/config/config-file#credentials-helpers


plugin_cache_dir             = "$HOME/.terraform.d/plugin-cache"
disable_checkpoint           = true
disable_checkpoint_signature = true


# provider_installation {
#  filesystem_mirror {
#    path    = "/usr/share/terraform/providers"
#    include = ["example.com/*/*"]
#  }
#  direct {
#    exclude = ["example.com/*/*"]
#  }
#  network_mirror {
#    url = "https://terraform.example.com/providers/"
#  }
# }

# credentials "app.terraform.io" {
#   token = "xxxxxx.atlasv1.zzzzzzzzzzzzz"
# }

# credentials_helper "example" {
#  args = []
# }
EOF

Setup terraform environment variabls

cat > ~/.terraform.env <<EOF
#!/bin/bash
#
# @reference:
#   https://registry.terraform.io/providers/hashicorp/aws/latest/docs

# PS4='+ $(date +"%F %T%z") ${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'

# Alias for Commands
alias tf="terraform"


# Env for Terraform
env -u TF_WORKSPACE
export TF_APPEND_USER_AGENT="youqing@argocd BuildID/$(date +%s) at $(date +%F_%T%z)"
export TF_LOG="trace"     # off|info|debug|trace
export TF_LOG_PATH="./.terraform/terraform.${TF_LOG}.log"
export TF_IGNORE="trace"
export TF_INPUT="0"
export TF_IN_AUTOMATION=1
export TF_CLI_ARGS=""
export TF_CLI_ARGS_plan="-refresh=false -input=false"
export TF_CLI_ARGS_apply="-auto-approve"
export TF_CLI_CONFIG_FILE="$HOME/.terraformrc-custom"
# export TF_DATA_DIR="${HOME}/.terraform.d"
export TF_REGISTRY_DISCOVERY_RETRY="3"
export TF_REGISTRY_CLIENT_TIMEOUT="3600"


# Env for AWS
# export AWS_ACCESS_KEY_ID=""
# export AWS_SECRET_ACCESS_KEY=""
# export AWS_DEFAULT_REGION="us-west-2"


# Env for AliCloud
export ALIYUN_ACCESS_KEY=""
export ALIYUN_SECRET=""
export ALIYUN_REGION="cn-beijing"


# Env for HuaweiCloud
export HW_ACCESS_KEY=""
export HW_SECRET_KEY=""
export HW_REGION_NAME="cn-north-1"  # https://developer.huaweicloud.com/endpoint


# Env for Vultr
export TF_VAR_vultr_api_key=""


# Env for Proxmox
# export PM_USER=""
# export PM_PASS=""
export PM_API_TOKEN_ID=""
export PM_API_TOKEN_SECRET=""


# Env for GitHub
export GITHUB_TOKEN_=""
export GITHUB_OWNER=""
export GITHUB_ORGANIZATION=""
EOF

Automation Scripts

Main Installation Script

Create a comprehensive installation script:

cat > ~/dev-environment-config/install.sh << 'EOF'
#!/bin/bash

set -e

echo "🚀 Setting up macOS Development Environment for SRE/DevOps Engineers"
echo "================================================================"

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

# Function to print colored output
print_status() {
    echo -e "${GREEN}[INFO]${NC} $1"
}

print_warning() {
    echo -e "${YELLOW}[WARNING]${NC} $1"
}

print_error() {
    echo -e "${RED}[ERROR]${NC} $1"
}

# Check if Homebrew is installed
if ! command -v brew &> /dev/null; then
    print_status "Installing Homebrew..."
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    # Add Homebrew to PATH
    if [[ $(uname -m) == 'arm64' ]]; then
        echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
    else
        echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zshrc
    fi
    source ~/.zshrc
else
    print_status "Homebrew already installed"
fi

# Update Homebrew
print_status "Updating Homebrew..."
brew update

# Install core tools
print_status "Installing core development tools..."
brew install git curl wget jq htop

# Install shell tools
print_status "Installing shell tools..."
brew install zsh fzf

# Install Oh My Zsh
if [ ! -d "$HOME/.oh-my-zsh" ]; then
    print_status "Installing Oh My Zsh..."
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
fi

# Install Oh My Zsh plugins
print_status "Installing Oh My Zsh plugins..."
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions

# Install container tools
print_status "Installing container and orchestration tools..."
brew install --cask docker
brew install kubectl kubectx k9s helm kind minikube

# Install Infrastructure as Code tools
print_status "Installing Infrastructure as Code tools..."
brew install terraform ansible

# Install Python and Node.js
print_status "Installing Python and Node.js..."
brew install python pyenv node

# Install database tools
print_status "Installing database tools..."
brew install postgresql redis mongodb/brew/mongodb-database-tools

# Install monitoring and debugging tools
print_status "Installing monitoring and debugging tools..."
brew install tcpdump nmap

# Install GUI applications
print_status "Installing GUI applications..."
brew install --cask iterm2 visual-studio-code

# Install FZF shell integration
print_status "Installing FZF shell integration..."
$(brew --prefix)/opt/fzf/install --all

# Install NVM
if [ ! -d "$HOME/.nvm" ]; then
    print_status "Installing NVM..."
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
fi

print_status "Installation completed successfully!"
print_status "Please restart your terminal or run: source ~/.zshrc"
print_status "Don't forget to configure your development tools using the configs in this repository"
EOF

chmod +x ~/dev-environment-config/install.sh

Git Setup Script

Create a script for Git configuration:

cat > ~/dev-environment-config/scripts/setup-git.sh << 'EOF'
#!/bin/bash

echo "🔧 Setting up Git configuration..."

# Copy global gitignore
cp configs/git/.gitignore_global ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global

# Configure Git
read -p "Enter your Git username: " git_username
read -p "Enter your Git email: " git_email

git config --global user.name "$git_username"
git config --global user.email "$git_email"
git config --global init.defaultBranch main
git config --global pull.rebase false
git config --global core.editor "code --wait"

echo "✅ Git configuration completed!"
EOF

chmod +x ~/dev-environment-config/scripts/setup-git.sh

Shell Setup Script

Create a script for shell configuration:

cat > ~/dev-environment-config/scripts/setup-shell.sh << 'EOF'
#!/bin/bash

echo "🔧 Setting up shell configuration..."

# Backup existing zshrc
if [ -f ~/.zshrc ]; then
    cp ~/.zshrc ~/.zshrc.backup.$(date +%Y%m%d_%H%M%S)
fi

# Copy new zshrc
cp configs/zsh/.zshrc ~/.zshrc

# Create necessary directories
mkdir -p ~/.terraform.d/plugin-cache
mkdir -p ~/.docker

# Copy Docker daemon config
cp configs/docker/daemon.json ~/.docker/

# Copy Terraform config
cp configs/terraform/.terraformrc ~/

echo "✅ Shell configuration completed!"
echo "Please restart your terminal or run: source ~/.zshrc"
EOF

chmod +x ~/dev-environment-config/scripts/setup-shell.sh

VS Code Extensions Installation

Create a script to install VS Code extensions:

cat > ~/dev-environment-config/scripts/setup-vscode.sh << 'EOF'
#!/bin/bash

echo "🔧 Installing VS Code extensions..."

# Core extensions
code --install-extension ms-vscode.vscode-json
code --install-extension ms-kubernetes-tools.vscode-kubernetes-tools
code --install-extension hashicorp.terraform
code --install-extension ms-azuretools.vscode-docker
code --install-extension redhat.vscode-yaml
code --install-extension ms-vscode.powershell
code --install-extension bradlc.vscode-tailwindcss
code --install-extension esbenp.prettier-vscode
code --install-extension ms-vscode.vscode-typescript-next

# Additional useful extensions
code --install-extension ms-vscode.vscode-python
code --install-extension bradlc.vscode-tailwindcss
code --install-extension ms-vscode.vscode-json
code --install-extension ms-vscode.vscode-markdown
code --install-extension ms-vscode.vscode-git
code --install-extension ms-vscode.vscode-git-graph
code --install-extension ms-vscode.vscode-gitlens
code --install-extension ms-vscode.vscode-git-history
code --install-extension ms-vscode.vscode-git-blame

echo "✅ VS Code extensions installation completed!"
EOF

chmod +x ~/dev-environment-config/scripts/setup-vscode.sh

Final Setup and Repository Management

Now let’s set up the repository and make it ready for use:

cd ~/dev-environment-config

# Initialize git repository
git init
git add .
git commit -m "Initial commit: Complete macOS development environment configuration"

# Create .gitignore for the config repository
cat > .gitignore << 'EOF'
# Personal configurations
configs/git/.gitconfig
configs/kubernetes/config
.env

# OS files
.DS_Store
Thumbs.db

# Temporary files
*.tmp
*.temp
*.log
EOF

# Add and commit .gitignore
git add .gitignore
git commit -m "Add .gitignore for configuration repository"

echo "✅ Configuration repository setup completed!"
echo "📁 Repository location: ~/dev-environment-config"
echo "🚀 Next steps:"
echo "   1. Push to GitHub: git remote add origin <your-repo-url>"
echo "   2. Run: ./install.sh"
echo "   3. Configure your tools using the setup scripts"

Best Practices for Configuration Management

Configuration Management Best Practices

  1. Version Control: Keep all configurations in version control for easy rollback and team sharing
  2. Environment Separation: Use different configurations for development, staging, and production
  3. Documentation: Document any customizations and their purposes
  4. Regular Updates: Keep tools and configurations up to date
  5. Backup Strategy: Always backup existing configurations before applying new ones

Security Considerations

Security Best Practices

  1. SSH Keys: Store SSH keys securely and never commit them to version control
  2. API Keys: Use environment variables for sensitive configuration
  3. Access Control: Limit access to configuration repositories based on team roles
  4. Audit Logs: Monitor access to sensitive configurations
  5. Encryption: Use GPG for signing commits and encrypting sensitive data

Conclusion

This comprehensive setup provides SRE/DevOps engineers with a professional, consistent, and maintainable development environment. The configuration management approach ensures easy replication across team members and new machines, while the automation scripts reduce setup time and eliminate configuration drift.

Key benefits of this approach:

  • Consistency: All team members have identical development environments
  • Reproducibility: Easy setup on new machines or after OS reinstalls
  • Maintainability: Centralized configuration management
  • Productivity: Pre-configured tools and aliases for common DevOps tasks
  • Collaboration: Easy sharing and version control of configurations

Remember to regularly update your tools and configurations, and always test changes in a safe environment before applying them to your main development setup.

Next Steps

  1. Push your configuration repository to GitHub
  2. Share with your team members
  3. Customize configurations based on your specific needs
  4. Document any additional tools or configurations you add
  5. Set up automated updates and maintenance procedures

Happy coding and happy DevOps! 🚀

YH

Youqing Han

DevOps Engineer

Share this article:

Stay Updated

Get the latest DevOps insights and best practices delivered to your inbox

No spam, unsubscribe at any time