Skip to content


📥 Setup your installation environment

  1. Set secrets variables provided by R2Devops in your shell
  2. Clone the repository on your server
    git clone https://r2devops:${REPOSITORY_TOKEN} r2devops
    cd r2devops
  3. Create your configuration files
    cp .env.example .env
    cp config.example.json config.json

📄 Domain name

  1. Edit the .env file by updating value of DOMAIN_NAME, CERTIFICATE_EMAIL and JOBS_GITLAB_URL variables


    Example with domain name

  2. Edit the config.json file by updating apiUrl, apiUrlIdentities and gitLabApiUrl parameters

        "appTitle": "R2Devops",
        "apiUrl": "https://api.r2devops.<domain_name>",
        "apiUrlIdentities": "https://api.r2devops.<domain_name>/kratos/public",
        "gitLabApiUrl": "https://<gitlab_intance_domain>",
        "selfHosted": true,
        "docUrl": ""

    Example with domain name

    "apiUrl": "",
    "apiUrlIdentities": "",
    "gitLabApiUrl": "",
  3. Create DNS records

    The application needs two DNS records to work properly:

    1. Frontend
      • Name: r2devops.<domain_name>
      • Type: A
      • Content: <your-server-public-ip>
    2. Backend
      • Name: api.r2devops.<domain_name>
      • Type: A
      • Content: <your-server-public-ip>

Domains & Certificates

For example, if you have the domain name

  • The frontend URL will be
  • The backend URL will be

All certificates will be auto-generated using Let's encrypt at the application launch

🦊 GitLab OIDC

R2Devops uses GitLab as an OIDC (OpenID Connect) provider to authenticate users. Let's see how to connect it to your GitLab instance.

Create an application

Choose a group on your GitLab instance to create an application. It can be any group. Open the chosen group in GitLab interface and navigate through Settings > Applications:


Then, create an application with the following information :


You need to replace <API_URL> below with the API URL consistently with what you have configured as backend DNS record and what you have in your .env file

  • Name: R2Devops self-hosted
  • Redirect URI : https://<API_URL>/kratos/public/self-service/methods/oidc/callback/gitlab
  • Confidential: true (let the box checked)
  • Scopes: openid, email

Click on Save Application and you should see the following screen:


Update the configuration

In .env file, in the OIDC section:

  1. Copy/paste the Application ID and the Secret from the application you just created
  2. Update the GITLAB_INSTANCE_DOMAIN value with the domain of your GitLab self-hosted instance
    "id": "gitlab",
    "provider": "gitlab",
    "issuer_url": "<GITLAB_INSTANCE_DOMAIN>",
    "client_id": "<APPLICATION_ID>",
    "client_secret": "<APPLICATION_SECRET>",
    "mapper_url": "file:///etc/config/kratos/oidc.gitlab.jsonnet",
    "scope": [

🔐 Generate secrets

Generate random secrets for all components:

sed -i "s/REPLACE_ME_BY_JOBS_DB_PASSWORD/$(openssl rand -hex 16)/g" .env
sed -i "s/REPLACE_ME_BY_JOBS_REDIS_PASSWORD/$(openssl rand -hex 16)/g" .env
sed -i "s/REPLACE_ME_BY_S3_SECRET_KEY/$(openssl rand -hex 16)/g" .env
sed -i "s/REPLACE_ME_BY_KRATOS_DB_PASSWORD/$(openssl rand -hex 16)/g" .env
sed -i "s/REPLACE_ME_BY_SECRET_COOKIE/$(openssl rand -hex 16)/g" .env
sed -i "s/REPLACE_ME_BY_SECRET_CIPHER/$(openssl rand -hex 16)/g" .env
sed -i "s/REPLACE_ME_BY_SECRET_DEFAULT/$(openssl rand -hex 16)/g" .env

🐳 Docker login

Login to R2Devops registry

echo $REGISTRY_TOKEN | docker login --username r2devops --password-stdin

🚀 Launch the application


You have successfully installed R2Devops on your server 🎉

Now you can launch the application and ensure everything works as expected.

Run the following command to start the system

docker compose up -d


If you need to reconfigure some files and relaunch the application, after your updates you can simply run the command again to do so.

docker compose up -d

What's next

Now that you have finished this tutorial, here are some simple tasks you should give a try :

  • 📈 Learn how to use the platform by reading the documentation
  • 📕 Import your first job, here is the tutorial

Not the same behavior

Did you encounter a problem during the installation process ? See the troubleshooting section.

Last update: February 27, 2023