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.
By Simon Vasconcelos Lee
Published on 29 November 202612 minute read
semaphoreui/semaphore and PostgreSQL 18, with port 3000 published on 127.0.0.1 behind an HTTPS reverse proxy.SEMAPHORE_ACCESS_KEY_ENCRYPTION in a .env file: the key encrypts every secret of the Key Store.pg_dump, the /etc/semaphore folder and your .env. To update, change the image tag: Semaphore migrates its database at startup.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.
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 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.
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:
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:
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:
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
127.0.0.1, here as port 8108 of the server: the documentation publishes it as 3000:3000, and Docker then opens it on every address of the server. Published locally, it is reachable only through the reverse proxy.semaphore as database password and changeme for the administrator. Here both are random, in hexadecimal so that they need no escaping.SEMAPHORE_ACCESS_KEY_ENCRYPTION encrypts the secrets of the Key Store in the database. The documentation asks for 32 random bytes in base64, which is what head -c32 /dev/urandom | base64 produces. Keep it with your backups: without it, the stored keys can no longer be read.SEMAPHORE_ADMIN variables create the first administrator, at the first start only: the image runs Semaphore’s setup when /etc/semaphore/config.json does not exist yet, then never again. Changing them later has no effect on the account.SEMAPHORE_WEB_ROOT is your public address, with https://. Semaphore uses it in the links of its alerts.config keeps the config.json written at first start, with the cookie keys and the database connection settings; tmp holds the clones of your repositories; data stays empty with PostgreSQL; postgres holds all your projects and task logs. PostgreSQL 18 keeps its files under /var/lib/postgresql, which is why the volume is mounted there.playbooks folder is mounted read-only in the container, as a local repository for the first task below. Your real playbooks will most likely live in Git.latest, which follows every release. A full version, here v2.20.23, lets you choose when each update happens. Tags ending in -ansible2.16.5 or -powershell7.5.0 bring another Ansible version or PowerShell.The first start creates the database tables and the administrator; on our test VPS, Semaphore answered within two seconds. To check that it responds:
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”.
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:
semaphore.example.com {
reverse_proxy 127.0.0.1:8108 {
header_up X-Real-IP {client_ip}
}
}
systemctl reload caddy
curl -sI https://semaphore.example.com/
HTTP/2 200 with the title “Dashboard - Semaphore UI”, and plain HTTP was redirected to HTTPS.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.
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:
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 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:
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:
/home/semaphore/playbooks and the access key “None”. A path that starts with / is a local folder, with no branch to choose.ping.yml, and the inventory, repository and variable group you just created. Save, then click Run.[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.
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:
(
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.
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:
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
--exit-on-error stops the restore at the first error, and the && stop the sequence there: Semaphore stays stopped. We checked it with a truncated dump: pg_restore stopped on “could not read from input file”, and the chain ended without starting Semaphore. Start again from dropdb once the cause is fixed.config.json, the image would run its setup again on the restored database. The tar line puts it back first.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.
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:
docker compose pull
docker compose up -d
docker compose logs semaphore | grep -i migrat
SEMAPHORE_MIGRATE_FROM_BOLTDB.develop tag follows the development branch: keep it for testing.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.
| Topic | Our teams | You |
|---|---|---|
| The server | System and security updates, server interventions included | The timing that suits you |
| Monitoring | Server monitored 24/7, with intervention without waiting for your call | Your projects, templates and schedules in Semaphore |
| Semaphore UI | Proactive monitoring: errors, slowdowns, database and disk space spotted, fix recommended | Its installation, updates, playbooks and settings, which you apply, yourself or through your AI assistant |
| Users | The server that carries them, monitored and backed up | Accounts, teams and roles |
| Backups | Every night, encrypted and kept off the machine; restores included | Semaphore’s own database dumps and configuration copies, and the restore request, when you need one |
| Migration | Your current server migrated, free of charge | The 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.
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.
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.
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.
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.
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.
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.
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.
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”.
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.
Simafri
Let's talk about your project
Tell us what you need in a few words: we will get back to you quickly.
Thank you! Your request has been sent. We'll get back to you shortly.
Prefer email? Write to us at support@simafri.com.