Configuration

There are 3 ways to configure Semaphore:

Snap configuration

Snap configurations should be used for when Semaphore was installed via Snap.

To see a list of available options, use the following command:

sudo snap get semaphore

You can change each of these configurations. For example if you want to change Semaphore port, use following command:

sudo snap set semaphore port=4444

Don't forget to restart Semaphore after changing a configuration:

sudo snap restart semaphore

Interactive setup

Use this option for first time configuration (not working for Semaphore installed via Snap).

semaphore setup

Configuration file

Semaphore uses a config.json configuration file with following content:

{
  "bolt": {
    "host": "/home/ubuntu/semaphore.bolt"
  },
  "mysql": {
    "host": "localhost",
    "user": "root",
    "pass": "*****",
    "name": "semaphore",
    "options": {}
  },
  "postgres": {
    "host": "localhost",
    "user": "postgres",
    "pass": "*****",
    "name": "semaphore",
    "options": {}
  },
  "dialect": "postgres",
  "port": "",
  "interface": "",
  "tmp_path": "/tmp/semaphore",
  "cookie_hash": "*****",
  "cookie_encryption": "*****",
  "access_key_encryption": "*****",
  "email_sender": "",
  "email_host": "",
  "email_port": "",
  "web_host": "",
  "ldap_binddn": "",
  "ldap_bindpassword": "",
  "ldap_server": "",
  "ldap_searchdn": "",
  "ldap_searchfilter": "",
  "ldap_mappings": {
    "dn": "",
    "mail": "",
    "uid": "",
    "cn": ""
  },
  "telegram_chat": "",
  "telegram_token": "",
  "concurrency_mode": "",
  "max_parallel_tasks": 0,
  "email_alert": false,
  "telegram_alert": false,
  "slack_alert": false,
  "slack_url": "",
  "rocketchat_alert": false,
  "rocketchat_url": "",
  "ldap_enable": false,
  "ldap_needtls": false
}

Configuration options

Configuration fileSnap configurationDescription
bolt.host—Path to the BoltDB database file
mysql.hostmysql.hostMySQL database host
mysql.namemysql.nameMySQL database (schema) name
mysql.usermysql.userMySQL user name
mysql.passmysql.passMySQL user's password
postgres.hostpostgres.hostPostgres database host
postgres.namepostgres.namePostgres database (schema) name
postgres.userpostgres.userPostgres user name
postgres.passpostgres.passPostgres user's password
dialectdialectCan be mysql, postgres or bolt
portportTCP port on which the web interface will be available. Default: 3000
interfaceinterfaceUseful if your server has multiple network interfaces
tmp_path—Path to directory where cloned repositories and generated files are stored. Default: /tmp/semaphore
access_key_encryptionaccess-key-encryptionSecret key used for encrypting access keys in database. Read more in Database encryption reference.
web_hostweb-hostCan be useful if you want to use Semaphore by the subpath, for example: http://yourdomain.com/semaphore. Do not add a trailing /.
email_senderemail-sender
email_hostemail-host
email_portemail-port
email_secureemail-secure
email_usernameemail-username
email_passwordemail-password
email_alertemail-alert
telegram_alerttelegram-alert
slack_alertslack-alertSet to True to enable pushing alerts to slack. It should be used in combination with slack_url
slack_urlslack-urlThe slack webhook url. Semaphore will used it to POST Slack formatted json alerts to the provided url.
rocketchat_alertrocketchat-alertSet to True to enable pushing alerts to Rocket.Chat. It should be used in combination with rocketchat_url. Available since v2.9.56.
rocketchat_urlrocketchat-urlThe rocketchat webhook url. Semaphore will used it to POST Rocket.Chat formatted json alerts to the provided url. Available since v2.9.56.
ldap_enableldap-enable
ldap_needtlsldap-needtls
ldap_binddnldap-binddn
ldap_bindpasswordldap-bindpassword
ldap_serverldap-server
ldap_searchdnldap-searchdn
concurrency_modeconcurrency-modeCan be unset/empty or project or node. When set to project, tasks will run in parallel if and only if they do not share the same project id, with no regard to the nodes/hosts that are affected. When set to node, a task will run in parallel if and only if the hosts affected by tasks already running does not intersect with the hosts that would be affected by the task in question. If concurrency_mode is not specified or left empty, no task will start before the previous one has finished.
max_parallel_tasksmax-parallel-tasksMax allowed parallel tasks if concurrency-mode is enabled. Can also be set/changed within the Web UI (project settings).
oidc_providers Static BadgeOpenID provider settings. You can provide multiple OpenID providers. More about OpenID configuration read in OpenID.
password_login_disable Static BadgeDisable login with using password. Only LDAP and OpenID.
non_admin_can_create_project Static BadgeAllow non-admin users to create new projects.

Public URL

If you use nginx or other web server before Semaphore, you should provide configuration option web_host.

For example you configured NGINX on the server which proxies queries to Semaphore.

Server address https://exmaple.com and you proxies all queries https://exmaple.com/semaphore to Semaphore.

Your web_host will be https://exmaple.com/semaphore.