Self-host Semaphore UI on a managed VPS: a web interface for Ansible

To self-host Semaphore UI on a managed VPS is to run your Ansible playbooks, Terraform code and scripts from a web interface on a server of your own, which our teams keep up to date and monitor day and night. Semaphore UI is a free, open source project under the MIT license, used by teams that have outgrown deploying from a terminal. This guide follows its official Docker image at version v2.20.23, and we ran every command on a Simafri VPS before writing it: installation with Docker Compose and PostgreSQL, HTTPS, the first sign-in, a first Ansible task, backups and updates.

Simon Vasconcelos Lee By Published on 29 November 202612 minute read

All guides Development and DevOps

In short

  1. The MIT license lets you run Semaphore UI for your company or your clients with no license to buy; the Pro and Enterprise editions are unlocked with a paid key in the same build.
  2. Install it with Docker Compose: the official image semaphoreui/semaphore and PostgreSQL 18, with port 3000 published on 127.0.0.1 behind an HTTPS reverse proxy.
  3. Put the database password, the first administrator’s password and SEMAPHORE_ACCESS_KEY_ENCRYPTION in a .env file: the key encrypts every secret of the Key Store.
  4. A first task takes five items: a project, a repository, an inventory, a variable group and a task template. A ping playbook checks that Ansible runs.
  5. Back up with pg_dump, the /etc/semaphore folder and your .env. To update, change the image tag: Semaphore migrates its database at startup.

What Semaphore UI does

Semaphore UI is a web interface for the tools that change your servers: you describe a task once, then anyone allowed can run it with a click, on a schedule or from an API call, and every run keeps its full log. It is written in Go, with a Vue interface, by Denis Gukov and its contributors.

What the MIT license allows

Semaphore UI is published under the MIT license. You can use it free of charge, for your own servers or your clients’ servers, copy it, modify it and redistribute it, provided the copyright and license notice stay with it. The software is provided without warranty.

Semaphore Pro and Enterprise are paid editions sold by its developers. They are activated with a license key in the same build, from the administration menu or the configuration, without reinstalling anything. Nothing in this guide needs them.

The resources to plan for

The documentation sets no minimum size, and Semaphore itself is light. Here is what we measured on our test VPS, freshly installed:

Server size therefore depends on how many tasks run at once and on what they do. On a managed VPS, tell us about your usage and we will recommend the right size.

Installing with Docker Compose

Semaphore ships as a single image, semaphoreui/semaphore, which serves the interface and the API on port 3000 and runs the tasks itself. Its documentation offers SQLite, MySQL and PostgreSQL; for a server, we use PostgreSQL in its own container. BoltDB, the embedded database of older versions, was removed in 2.19. On a server with Docker Engine and its Compose plugin, installed from Docker’s repository for Ubuntu, create a folder such as /opt/semaphore, with a playbooks folder for your first task:

Terminal, as root
mkdir -p /opt/semaphore/playbooks

Then put this compose.yaml in it, based on the PostgreSQL file of the Docker page and on the volumes of the official Container Configurator:

compose.yaml
services:
  postgres:
    image: postgres:18-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER: semaphore
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
      POSTGRES_DB: semaphore
    volumes:
      - postgres:/var/lib/postgresql
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U semaphore -d semaphore"]
      interval: 5s
      timeout: 5s
      retries: 10

  semaphore:
    image: semaphoreui/semaphore:v2.20.23
    restart: unless-stopped
    ports:
      - "127.0.0.1:8108:3000"
    environment:
      SEMAPHORE_DB_DIALECT: postgres
      SEMAPHORE_DB_HOST: postgres
      SEMAPHORE_DB_PORT: 5432
      SEMAPHORE_DB_USER: semaphore
      SEMAPHORE_DB_PASS: ${POSTGRES_PASSWORD}
      SEMAPHORE_DB: semaphore
      SEMAPHORE_ADMIN: admin
      SEMAPHORE_ADMIN_NAME: Admin
      SEMAPHORE_ADMIN_EMAIL: admin@example.com
      SEMAPHORE_ADMIN_PASSWORD: ${SEMAPHORE_ADMIN_PASSWORD:?set SEMAPHORE_ADMIN_PASSWORD in .env}
      SEMAPHORE_ACCESS_KEY_ENCRYPTION: ${SEMAPHORE_ACCESS_KEY_ENCRYPTION:?set SEMAPHORE_ACCESS_KEY_ENCRYPTION in .env}
      SEMAPHORE_WEB_ROOT: https://semaphore.example.com
      TZ: UTC
    volumes:
      - config:/etc/semaphore
      - data:/var/lib/semaphore
      - tmp:/tmp/semaphore
      - ./playbooks:/home/semaphore/playbooks:ro
    depends_on:
      postgres:
        condition: service_healthy

volumes:
  postgres:
  config:
  data:
  tmp:

The three secrets go in a .env file next to it, which Docker Compose reads on its own; until it exists, Compose refuses to start and names the missing variables. Create it readable by root only, then start the stack:

Terminal, in /opt/semaphore
umask 077
printf 'POSTGRES_PASSWORD=%s\nSEMAPHORE_ADMIN_PASSWORD=%s\nSEMAPHORE_ACCESS_KEY_ENCRYPTION=%s\n' "$(openssl rand -hex 24)" "$(openssl rand -hex 16)" "$(head -c32 /dev/urandom | base64)" > .env
umask 022
docker compose up -d
docker compose ps

The first start creates the database tables and the administrator; on our test VPS, Semaphore answered within two seconds. To check that it responds:

Terminal
curl -s http://127.0.0.1:8108/api/ping

The answer is pong. docker compose logs semaphore shows the setup, with the line “You are all setup Admin!”, then “Server is running”.

HTTPS: the reverse proxy

The container serves Semaphore over HTTP. HTTPS is handled by a reverse proxy in front of it, which must pass WebSocket connections: the interface receives its live updates through them. We tested Caddy, installed from its official Debian and Ubuntu repository: it obtains the Let’s Encrypt certificate itself, renews it, and handles WebSockets without extra settings. The block below is the one of Semaphore’s Caddy page, with your port:

/etc/caddy/Caddyfile
semaphore.example.com {
	reverse_proxy 127.0.0.1:8108 {
		header_up X-Real-IP {client_ip}
	}
}
Terminal, as root
systemctl reload caddy
curl -sI https://semaphore.example.com/

The first sign-in and the other users

Open your address: Semaphore shows its sign-in page. Sign in as admin, or with the email address of SEMAPHORE_ADMIN_EMAIL, with the password of SEMAPHORE_ADMIN_PASSWORD, which you read in the .env file. On our test VPS, a wrong password was refused, and the account had the administrator flag.

A forgotten administrator password

Semaphore’s command line changes a password without the old one. Run it in the container, then sign in with the new password it shows:

Terminal, in /opt/semaphore
NEW_PASSWORD=$(openssl rand -hex 16)
docker compose exec -T semaphore semaphore user change-by-login --config /etc/semaphore/config.json --login admin --password "$NEW_PASSWORD"
echo "$NEW_PASSWORD"

We tested it on our VPS: the old password was refused, the new one accepted, and still accepted after the container was recreated, since the setup does not run again.

A first Ansible task

A task in Semaphore always comes from a task template, which ties together a repository, an inventory and a variable group. To check the whole chain before you connect your own Git repository, start with a playbook that pings the Semaphore server itself, in the playbooks folder mounted earlier:

Terminal, in /opt/semaphore
cat > playbooks/ping.yml <<'EOF'
- name: Check that Semaphore can run Ansible
  hosts: all
  gather_facts: false
  tasks:
    - name: Ping
      ansible.builtin.ping:
EOF

Then, in the interface:

  1. New Project: give it a name. Semaphore adds a key named “None” to its Key Store, for what needs no secret.
  2. Repositories, New Repository: a name, the URL /home/semaphore/playbooks and the access key “None”. A path that starts with / is a local folder, with no branch to choose.
  3. Inventory, New Inventory: the type “Static”, the key “None”, and the content below, which runs the playbook on the container itself.
  4. Variable Groups, New Group: a group named “Empty”, with no variables, for templates that need none.
  5. Task Templates, New Template, Ansible: the name “Ping”, the playbook ping.yml, and the inventory, repository and variable group you just created. Save, then click Run.
Inventory content
[local]
localhost ansible_connection=local

The task log shows ok: [localhost] and the task ends in success. Ansible also prints a warning about the Python interpreter it discovered in the image, which is harmless here. On our test VPS, we created these five items through the API that the interface itself calls, with the same fields, and the task succeeded in a few seconds.

For your own playbooks, add a Git repository instead: its URL and branch, with an SSH key or a login and token saved in the Key Store. Your inventories then list your servers, with the SSH key Semaphore uses to reach them.

Backups

Everything lives in three places: the PostgreSQL database, with your projects, keys and task logs; the /etc/semaphore folder, with its config.json; and your .env file, whose SEMAPHORE_ACCESS_KEY_ENCRYPTION is needed to read the stored keys. The PostgreSQL image includes pg_dump, and the Semaphore image tar. These copies hold secrets, so create them readable by root only, with umask 077 inside parentheses: the rest of your session keeps its usual mask. A file that already exists keeps its permissions when it is overwritten, so the last line also closes the copies already in the folder:

Terminal, in /opt/semaphore
(
  umask 077
  docker compose exec -T postgres pg_dump -U semaphore -Fc semaphore > semaphore-$(date +%F).dump
  docker compose exec -T semaphore tar czf - -C /etc/semaphore . > config-$(date +%F).tar.gz
  cp .env env-$(date +%F).bak
  chmod 600 semaphore-*.dump config-*.tar.gz env-*.bak
)

Schedule this copy and send it off the server, with compose.yaml and your local playbooks. Stored on the disk, the copies are also included in the server’s nightly backups.

Restoring

On the same or a new installation, with the same .env, stop Semaphore, replace the database with an empty one, load the dump into it, put the configuration back, then start Semaphore again:

Terminal, in /opt/semaphore
docker compose stop semaphore &&
docker compose exec -T postgres dropdb -U semaphore semaphore &&
docker compose exec -T postgres createdb -U semaphore semaphore &&
docker compose exec -T postgres pg_restore -U semaphore -d semaphore --exit-on-error --no-owner < semaphore-2026-11-20.dump &&
docker compose run --rm --no-deps -T --entrypoint tar semaphore xzf - -C /etc/semaphore < config-2026-11-20.tar.gz &&
docker compose start semaphore

We tested the whole cycle on our VPS with these exact commands: backup, a project created after it, config.json deleted, then the restore. The project, its repository, inventory, template and successful task came back, the later project was gone, and a new run of the template succeeded at once.

Updates

Semaphore is released often, with release candidates in between: stay on the versions published as releases on GitHub. Read the release notes, take a backup, change the image tag in the compose.yaml, then pull the new image and recreate the container. The database migrations run on their own at startup:

Terminal, in /opt/semaphore
docker compose pull
docker compose up -d
docker compose logs semaphore | grep -i migrat

Who does what on a managed VPS

Self-hosting means running the server on top of the application. On a managed VPS, our teams take charge of the server and proactively monitor your instance; Semaphore UI remains your software, with your projects and your settings.

TopicOur teamsYou
The serverSystem and security updates, server interventions includedThe timing that suits you
MonitoringServer monitored 24/7, with intervention without waiting for your callYour projects, templates and schedules in Semaphore
Semaphore UIProactive monitoring: errors, slowdowns, database and disk space spotted, fix recommendedIts installation, updates, playbooks and settings, which you apply, yourself or through your AI assistant
UsersThe server that carries them, monitored and backed upAccounts, teams and roles
BackupsEvery night, encrypted and kept off the machine; restores includedSemaphore’s own database dumps and configuration copies, and the restore request, when you need one
MigrationYour current server migrated, free of chargeThe timing of the switch

If you would rather have our teams work inside the application itself, that service is billed by the hour or at a fixed rate, with an estimate shared before the work starts.

Semaphore UI, on a server run for you

With a Simafri Managed VPS, our teams keep your Semaphore UI instance’s server up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is free.

Explore Managed VPS

Frequently asked questions

Is Semaphore UI free?

Yes. Semaphore UI is under the MIT license: you can run it for your company or your clients with no license to buy. The Pro and Enterprise editions are optional paid keys that unlock features in the same build. What remains is the cost of the server that runs it.

How do I install Semaphore UI with Docker Compose?

Use the semaphoreui/semaphore image and PostgreSQL 18 in a compose.yaml. Put the database password, the administrator password and SEMAPHORE_ACCESS_KEY_ENCRYPTION in a .env file, keep /etc/semaphore in a volume, publish port 3000 on 127.0.0.1, run docker compose up -d, and put an HTTPS reverse proxy in front.

Which database should Semaphore UI use?

PostgreSQL or MySQL for a server; SQLite works for a trial. BoltDB was removed in version 2.19, and an instance still on it must be migrated before it upgrades.

What is the default Semaphore UI login?

There is none built in: the Docker image creates the first administrator from SEMAPHORE_ADMIN, SEMAPHORE_ADMIN_EMAIL and SEMAPHORE_ADMIN_PASSWORD at its first start. The documentation’s example uses admin and changeme; set a password of your own before the first start.

How do I reset the Semaphore UI admin password?

Run semaphore user change-by-login --config /etc/semaphore/config.json --login admin --password with a new password, inside the container, through docker compose exec. Changing SEMAPHORE_ADMIN_PASSWORD afterwards has no effect, since the setup runs only once.

How do I back up Semaphore UI?

Dump the PostgreSQL database with pg_dump -Fc, archive the /etc/semaphore folder and copy your .env file, under umask 077 so that only root can read them. To restore, stop Semaphore, recreate the database empty with dropdb and createdb, load the dump with pg_restore --exit-on-error --no-owner, put /etc/semaphore back, then start it.

How do I update Semaphore UI?

Read the release notes and take a backup, change the image tag in compose.yaml, then run docker compose pull and docker compose up -d. The database migrations run on their own at startup, and the logs end them with “Migrations Finished”.

Does a managed VPS cover Semaphore UI?

A managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your instance and recommend useful fixes, which you apply. Work inside the application is billed by the hour or at a fixed rate.

Contact us