If you manage your own Dockerfile images, Helm Charts, Docker compose files or a something similar in your GitLab, keeping everything up-tp-date is an important task, which can consume a lot of time and energy every week.
Usually you would have to check each and every one of your images, charts or Docker files for new versions.
The best one could hope for is an application which gets used a lot and sends automatic push notifications or mails that a new important update is available.
Unfortunately many selfhosted applications don't deliver these informations or get used often enough to notice that an important security patch has been released a week ago.
Additionally it consumes a lot of time and nerves to look for new versions in different image repositories or documentations.
Renovate Bot was created to specifically fix those annoying issues. It automatically looks for new versions or tags for the selfhosted applications managed in GitLab and opens a merge request with the new version.
This article shows how to install the Renovate Bot from mend.io with Docker compose and how to configure it.
The installation is a bit complex and has a lot of steps in comparison to other Docker compose applications, which is why it is divided in smaller sections.
Before beginning the installation please create a new directory on the VM where the Renovate Bot is gonna run.
The renovate bot from mend.io is available as a paid service, if you want to selfhost it you just need to create a free account and get your license key.
To begin with please head over to this link, where you can create your own account free of charge and copy the license key you will need later on in the guide.

Next up you have to create a new GitLab account for the renovate bot. For this please head over to the admin panel by clicking the “Admin” button on the top right corner of the screen and then navigate to the “Users” section on the left menu.
Now, in the middle of the screen, press the button “New user”.

mend.io recommends to use the name “Renovate Bot” and the username “renovate-bot”. An email, profile picture and an admin note are optional, but are recommend and useful to know why this account exists and document who created it.

After creating the user we need to impersonate it, to create a personal access token.
For this click on the newly created renovate user and press the button “Impersonate” to take control of it and create the personal access token (PAT).

For this press the profile picture of the account on the top right and select “Edit profile”.

Now under “Access”, select “Personal access tokens” and press the button “Generate token” in the middle of the screen. Afterwards select the “Legacy token” type.
Don't be confused by the fact that there is already one PAT present, if this is a newly generated account there won't be any tokens present.

When creating the PAT please select the following 3 scopes like seen in the screenshot:
Also select a name which instantly lets you know the purpose of this access token.
Unfortunately GitLab doesn't allow the personal access tokens to be active for more than 1 year. I recommend setting a calender event or an alarm for a few days prior to the PAT expiring.
Otherwise you probably will wonder why the renovate bot didn't create any merge requests in the last few weeks, to then check the logs and see many permission denied messages. Don't ask me how I know.

Finally the newly generated token, which is only visible once, can be saved before it being used in the next step as the MEND_RNV_GITLAB_PAT variable.
Next up a new webhook secret / GitLab system hook has to be created. For this exit out of the impersonation and switch back to an admin account.
In the admin area select “System hooks” on the left and click on “Add new webhook” in the middle of the page.

The URL of this system hook has to be the IP or the URL where the renovate bot will be deployed.
In this example the VM, with the IP 10.0.0.10, of the GitLab is als othe machine where the renovate bot will be running.
In the docker-compose.yaml file, which will be created in the following steps, a certain port will be mapped to the container port 8080.
The port on the VM side has to be added to the URL of the system webhook.
Examples:
Now GitLab can create a signing token for you, if you wouldn't implement it, everything could send actions to this webhook.
This signing token is also only available once so you have to copy it now and save it somewhere else.
Later the token will be saved in the MEND_RNV_WEBHOOK_SECRET variable in the mend-renovate.env file.
In the options of “Trigger” please only select “Push events” and deselect the “Repository update events”.
Since the network traffic between the renovate bot and GitLab never leaves the VM, the box for “SSL verification” can be deselected.
If we would send this network traffic to another VM with e.g. traefik, we would need to activate SSL and use HTTPS addresses.
Afterwards click on “Add webhook”.

If you want to include the changelogs of any applications, which push changelogs on GitHub, you need to create a personal access token with your personal GitHub account.
The personal access token only needs reading permissions and then can be saved in the RENOVATE_GITHUB_COM_TOKEN variable in the mend-renovate.env file.
This it the link to the official template for the Docker compose from mend.io. I will be showing a custom version adjusted by me fitting my setup.
If any options or variables don't seem to make sense or won't work please use the official documentation.
The Docker compose won't include any sensitive data, this data will be saved in the mend-renovate.env file.
docker-compose.yaml
---
services:
renovate-ce:
# please check for newer versions here: https://github.com/mend/renovate-ce-ee/pkgs/container/renovate-ce
image: ghcr.io/mend/renovate-ce:15.5.0
ports:
- "8081:8080" # "[external / VM]:[internal / container]"
env_file:
- ./mend-renovate.env # File to include the env variables like personal access tokens
environment:
LOG_LEVEL: debug # Default is 'info', but 'debug' prints a lot of more useful information, especially if you need debugging logs when setting up the renovate bot
MEND_RNV_REQUEST_LOGGER_ENABLED: true
# API settings
MEND_RNV_REPORTING_ENABLED: true
MEND_RNV_LOG_HISTORY_DIR: /logs
MEND_RNV_SQLITE_FILE_PATH: /db/renovate-db.sqlite
# Renovate CLI configuration options
RENOVATE_REPOSITORY_CACHE: "enabled"
MEND_RNV_ENQUEUE_JOBS_ON_STARTUP: "enabled"
MEND_RNV_PLATFORM=gitlab
MEND_RNV_ENDPOINT='http://gitlab/api/v4/'
# This looks wrong, but works as intended, because GitLab and the renovate bot will be running on the same VM
RENOVATE_GIT_URL: endpoint
volumes:
- ./tmp/renovate-logs:/logs
- ./tmp/renovate-db:/db
restart: unless-stopped
networks:
- default
- traefik
container_name: renovatebot
networks:
traefik:
external: true
...
The variable MEND_RNV_ENDPOINT does have the specified value on purpose, since both GitLab and renovate bot will be running on the same VM. This means, that the traffic won't leave the docker network, since it uses the container name in the endpoint URL.
When both applications are hosted on different VMs / systems it's useful to use the usual HTTPS URL from GitLab.RENOVATE_GIT_URL may then lead to unexpected behavior and has to be altered or deleted altogether.
In the mend-renovate.env every previously created license key, personal access token and secret will be saved.
mend-renovate.env
MEND_RNV_ACCEPT_TOS=y # Accept the terms of service of mend.io
MEND_RNV_LICENSE_KEY=[Add the mend.io license key here]
MEND_RNV_GITLAB_PAT=[Add the GitLab personal access token of the renovate bot here]
MEND_RNV_WEBHOOK_SECRET=[Paste the GitLab webhook secret here]
RENOVATE_GITHUB_COM_TOKEN=[Add the GitHub personal access token here] # Otherwise the renovate bot won't be able to read changelogs from GitHub
Additionally we have to create a directory called “tmp”. In this directory another 2 directories called “renovate-db” and “renovate-logs” have to be created.
Please execute these commands in the same directory where the docker-compose.yaml is safed.
mkdir -p ./tmp/renovate-db
mkdir ./tmp/renovate-logs
The permissions of the just generated directories have to be changed with the following command.
sudo chmod 777 -R ./tmp/
The configuration of the renovate bot is now complete and it now can be started via the command docker compose up -d.
When starting the bot for the first time the image needed will be downloaded and unpacked which may take some time.
When executing docker ps you will be able to see all currently running docker containers.
Please copy the ID of the renovate bot container and run docker logs [CONTAINERI_ID_HERE] to see all the logs of the container.
There will be a lot of outpute, since we set the log level todebug, which sends the most amount of logs. This can be lowered later on when everything is set up and running as expected.
If everything worked as planned the bot will now scan every available repository. It is very important to know, that if a GitLab repository has been set to private, renovate bot won't be able to find the repo.
If the repository is set to private, it needs to be added to the repository or the group above it as at least with the role “Developer”.
If the bot has the correct permissions it will automatically create a merge request, which will add a new file with the name renovate.json.
You can merge this merge request, since this file is needed for renovate bot to automatically scan all the repository files to find the newest versions of all applications.
If you don't want renovate bot to scan certain repositories, simply revoke their access or don't add the renovate.json. Then it won't create any merge requests or scan the content of the repository.
Renovate bot offers a lot more possibilities to configure it, than I am able to show you in this article. This official documentation lists all the possibilites to configure the bot.
I will show you the way I manage the renovate bot configuration using one central GitLab repository and just one file.
First a new GitLab repository has to be created to house the repo of the renovate bot configuration, if it isn't existing yet.
In my case I created a new GitLab group for all the central settings I may want to set in the future. Following that I created a repo called “renovate-bot-settings”.

This repository only contains one file called default.json to save the standard settings / configuration for the renovate bot to use. If I ever want or need to change these settings I easily can access this file and change it.
Please don't forget, that the renovate bot also needs permissions in this repository to access the configuration file.
In the example below I'm showing my configuration file, please beware, that all the comments in the file need to be deleted, since json doesn't allow any comments.
default.json
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended", # Extends the config already present with recommended additional settings
"mergeConfidence:all-badges", # Adds a badge to each merge request on how possible the success of the version upgrade is in %
# It calcutes the possibility by comparing to the success percentage of other people
"group:monorepos", # Packages from the same repositories will be grouped to one single merge request
"group:recommended", # Packages of recommended repositories will be grouped to one single merge request
"group:linters"], # Packages of linting software (linting = checking file syntax) will be grouped to one single merge request
"assignees": ["@YourGitLabUsernameHere"], # Default assignee for the merge request, adding this only makes sense if you alone manage all the different applications
"timezone": "Europe/Berlin", # Right timezone for Germany
"configMigration": true, # If the configuration / syntax of renovate bot changes, this will automatically open a merge request with the new correct syntax
"vulnerabilityAlerts": { "enabled": true, "labels": ["security"] } # If a security issue gets patched with a new version, the merge request will get the label “security”
# Especially useful for automatisations, e.g. automatic notification of any open security issues of your applications
}
Afterwards we need to create a new file called config.js in the same directory as the docker-compose.yaml.
This file will manage the default configuration of the renovate bot to include the settings from the just created default.json.
At every start of the renovate bot container it will look for this repository and use the settings from it.
config.js
module.exports = {
onboardingConfig: {
$schema: "https://docs.renovatebot.com/renovate-schema.json", // Official schema
extends: ["local>central-settings/renovate-bot-settings"] // Our new repository containg the additional central settings
}
};
For this new config.js to be accessible by the renovate bot we need to make a few small changes to the docker-compose.yaml.
volumes:
- ./config.js:/opt/renovate/config.js:ro # The config.js will be mounted as ro (read-only)
environment:
RENOVATE_CONFIG_FILE: /opt/renovate/config.js
Restart the renovate bot and it should now use the new configuration from the GitLab repository.
Repos which still have the old renovate.json need to be manually edited to include the new file. Just change it manually like the following example seen below.
renovate.json
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>central-settings/renovate-bot-settings"]
}
New repositories will be initialized / onboarded with the correct renovate.json file. If they aren't, something isn't working.
sudo chown -R 12021:0 ./tmp/. As it seems the user called “debian” with the UID (User ID) 12021 needed ownership. After changing the ownership everything worked as intended.MEND_RNV_ENDPOINT variable, since it contains the URL for the GitLab container. The container name of the GitLab Docker compose had to be changed to container_name: gitlab using the docker-compose.yaml. At the same time it was really important to set the env variable RENOVATE_GIT_URL: endpoint for the setup to work.