Run GitLab console on Synology NAS



As the Synology DSM uses Docker to run GitLab, we can use Docker as well to install GitLab. To run the GitLab console, connect to the Synology using SSH first:

ssh <admin-user>@<synology> -p <port>

Then, connect to the GitLab container by using the following command:

docker exec -it synology_gitlab /bin/bash

Note: you might adjust the name of the GitLab docker depending on your system. In the example above, synology_gitlab was used.

Then you can open the console:

gitlab-rails console

When GItLab is installed using the DSM package manager, just use the following commands instead of the one above:

cd /home/git/gitlab/bin
./rails console production

Commands for the GitLab console

The Rails console provides a way to interact with your GitLab instance from the command line, and also grants access to the amazing tools built right into Rails. […] The Rails console is for GitLab system administrators who are troubleshooting a problem or need to retrieve some data that can only be done through direct access of the GitLab application.

Below are some examples of console commands and how to perform specific actions. In my case, I needed to check for the mail delivery settings: verify the delivery method, verify the SMTP settings and send a test email.

Check the mail delivery method


Output might be: => :smtp

Check the smtp settings


Output might be: => {:address=>"", :port=>25, …

Testing the SMTP configuration

You can verify that GitLab can send emails properly using the Rails console. As described in the documentation, you can enter the following command at the console prompt to cause GitLab to send a test email:

Notify.test_email('', 'Subject', 'Mail Body').deliver_now


Leave a Reply

Your email address will not be published. Required fields are marked *