install docker :

apt install

install docker-compose :


mkdir -p $DOCKER_CONFIG/cli-plugins

curl -SL -o $DOCKER_CONFIG/cli-plugins/docker-compose

chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

docker compose version

install GitLab self-hosted:


## change host name in docker compose to your domain 

docker-compose up

install nginx :

apt install nginx

configure reverse proxy :

sudo unlink /etc/nginx/sites-enabled/default

cd /etc/nginx/sites-available/

vi reverse-proxy.conf

# add this lines 
   server {
        location / {
            proxy_redirect     off;
            proxy_set_header   Host $host;
            proxy_set_header   X-Real-IP $remote_addr;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header   X-Forwarded-Host $server_name;

# save file and exit 

sudo ln -s /etc/nginx/sites-available/reverse-proxy.conf /etc/nginx/sites-enabled/reverse-proxy.conf

service nginx configtest

service nginx restart

install ssl by cerbot :

sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx

sudo certbot --nginx -d -d

#renew automaticly 
sudo certbot renew --dry-run
sudo crontab -e

30 3,15 * * * /usr/bin/certbot renew >> /var/log/letsencrypt/renew.log

create a backup of docker compose gitlab :

docker-compose rm -sf gitlab

docker-compose run --rm gitlab app:rake gitlab:backup:create

backupfile is available in :


restore backup :

docker-compose run --rm gitlab app:rake gitlab:backup:restore # List available backups

docker-compose run --rm gitlab app:rake gitlab:backup:restore BACKUP=1515629493_2020_12_06_13.10.0 # Choose to restore from 1515629493

make sure backup file ownership (chwon) is currently (make sure to not be root , for example you can create a backup and check that file ownership and change the ownership like that )

Leave a Reply

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