A simple one-command script to install GitLab Community Edition on Ubuntu 22.04 (Jammy).
Supports both IP-based and domain-based setups, with optional HTTPS + Let’s Encrypt.
- Ubuntu 22.04 LTS (Jammy)
- Root or sudo privileges
- Public IP address
- (Optional) A valid domain name pointing to the server IP
sudo bash install_gitlab.shDuring installation:
- Enter your server IP
- Choose whether you have a domain
- Optionally enable HTTPS + Let’s Encrypt
-
Via IP:
http://<SERVER_IP> -
Via domain:
https://gitlab.<your-domain>
View your initial root password:
sudo cat /etc/gitlab/initial_root_password- Username:
root - Password: (value from file above)
-
Point your domain to the server IP.
-
Edit:
# /etc/gitlab/gitlab.rb external_url "https://gitlab.yourdomain.tld" letsencrypt['enable'] = true letsencrypt['contact_emails'] = ['you@example.com']
-
Apply changes:
sudo gitlab-ctl reconfigure
sudo gitlab-ctl status
sudo gitlab-ctl reconfigure
sudo gitlab-ctl tail
sudo gitlab-rake gitlab:backup:createBackups are stored in
/var/opt/gitlab/backups/.