Created
May 6, 2021 21:42
-
-
Save edwardinubuntu/8c37eb754851a8c29107e64baaf3a178 to your computer and use it in GitHub Desktop.
Install Gitlab on Linux server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yum update | |
sudo yum update -y | |
# Install docker | |
sudo amazon-linux-extras install docker | |
sudo service docker start | |
sudo usermod -a -G docker ec2-user | |
exit | |
# Verify docker is ready | |
docker info | |
# Set up host name | |
sudo hostnamectl set-hostname gitlab | |
# Setup gitlab home path | |
export GITLAB_HOME=/srv/gitlab | |
# Install nginx | |
sudo amazon-linux-extras install nginx1 | |
# Start the nginx | |
sudo systemctl start nginx | |
# Docker run gitlab | |
docker run --detach --hostname <your_domain_name> --publish 81:80 --publish 1022:22 --name gitlab --restart always --volume $GITLAB_HOME/config:/etc/gitlab --volume $GITLAB_HOME/logs:/var/log/gitlab --volume $GITLAB_HOME/data:/var/opt/gitlab gitlab/gitlab-ee:latest | |
# Make sure the container is running | |
docker ps -a | |
# Start to build SSL for gitlab url https | |
sudo vi /etc/nginx/conf.d/gitlab.conf | |
sudo systemctl reload nginx | |
# Install Certbot | |
wget -O epel.rpm –nv https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | |
sudo yum install -y ./epel.rpm | |
sudo yum install python2-certbot-nginx.noarch | |
# Start to create ssl file for the domain name | |
sudo certbot --nginx | |
# Go into contrainer, setup SMTP in gitlab | |
docker exec -it gitlab /bin/bash | |
docker stop gitlab | |
docker start gitlab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment