In this guide, we will walk you through how to install Pmbot as a self hosted service via docker-compose.

We'll start off with a basic docker-compose.yml :

version: "3.6"

services:
  reverse-proxy:
    image: pmbot/reverse-proxy
    restart: unless-stopped
    ports:
      - 9118:80

  backend:
    image: pmbot/backend-community
    restart: unless-stopped
    volumes:
      - secrets:/secrets
      - /ca/my-company.pem:/ca/cert.pem
    environment:
      NODE_EXTRA_CA_CERTS: /ca/cert.pem
      APP_UI_URL: http://192.168.1.54:9118

  frontend:
    image: pmbot/ui
    restart: unless-stopped
    environment:
      PMBOT_API_URL: http://192.168.1.54:9118

  mongo:
    image: mongo:4.2-bionic
    restart: unless-stopped
    volumes:
      - mongo:/data/db

volumes:
  mongo:
  secrets:

Important things in the above YAML:

  • Because our Gitlab instance uses a self signed certificate, we provide the backend with the proper certificate chain via a docker volume /ca/my-company.pem:/ca/cb.pem and we load the certificate with NODE_EXTRA_CA_CERTS: /ca/cb.pem.
  • Both APP_UI_URL and PMBOT_API_URL should be set to the IP of the machine on which you are exposing Pmbot. This ensure that URLs are correctly displayed in registration emails and in the UI (code snippets, example configs, etc). You can skip this if you're only deploying on your local machine, but know that some code snippets will need to be adapted when you copy/paste them.

Now, just run docker-compose up -d and browse to http://192.168.1.54:9118, and you'll get to the setup screen:

You can fill in the form and then create your account.

You will now be asked to complete a setup wizard which walks you through creating your first Git provider and CI provider.

Read further: