Post

Deploy Self-Hosted GitLab on Ubuntu with Ansible

Deploy Self-Hosted GitLab on Ubuntu with Ansible

*GitLab is a unified DevOps platform that empowers teams to manage every phase of the software development lifecycle—from planning and source code management to CI/CD and deployment within a single application. *

🎞️ Watch Video

Prerequisites:

  • Ubuntu 24.04 or compatible Linux distribution
  • Ansible installed (for running Ansible playbooks)
  • Ansible knowledge

Create a inventory file:

1
2
3
4
5
6
7
8
9
[gitlab]
gitlab-server ansible_host=X.X.X.X  #host ip addess

[all:vars]
ansible_python_interpreter=/usr/bin/python3

[gitlab:vars]
ansible_ssh_private_key_file=/home/mkbntech/.ssh/id_ed25519
ansible_user=root

To set up a gitlab instance, run the following Ansible playbook:

1
2
3
4
5
- name: Setup self-hosted gitlab server
  hosts: gitlab
  become: true
  roles:
    - self-hosted-gitlab-instance

Executing the role to install gitlab server

1
$ ansible-playbook -i inventory playbook.yaml
This post is licensed under CC BY 4.0 by the author.