Skip to content

SaltStack: Introduction & Getting Started

SaltStack (Salt) is an open-source automation and configuration management tool designed for fast, scalable, and secure infrastructure automation.

Why Use SaltStack?

  • Automate configuration and deployment
  • Manage large-scale infrastructure
  • Real-time remote execution
  • Event-driven automation

How SaltStack Works

  • Uses a master/minion architecture (or masterless mode)
  • States define desired system configuration in YAML
  • Modules perform actions (e.g., install packages, manage services)

Quick Start Example

  1. Install Salt (master and minion):
    sudo apt install salt-master salt-minion
    # or use pip for latest version
    pip install salt
    
  2. Start the master and minion services:
    sudo systemctl start salt-master
    sudo systemctl start salt-minion
    
  3. Accept the minion key on the master:
    sudo salt-key -A
    
  4. Write a simple state file (apache.sls):
    install_apache:
      pkg.installed:
        - name: apache2
    
  5. Apply the state to the minion:
    sudo salt '<minion-id>' state.apply apache
    

Learn More