Official Getting Started Guide
sudo apt update
sudo apt install -y curl openssh-server ca-certificates perl tzdataAdd the GitLab repository and install GitLab CE:
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo EXTERNAL_URL="http://your-server-ip" apt install gitlab-ceIf password is not displayd, show with cat /etc/gitlab/initial_root_password
Edit the GitLab config:
sudo nano /etc/gitlab/gitlab.rbModify the following:
puma['worker_processes'] = 2
sidekiq['concurrency'] = 9
prometheus_monitoring['enable'] = falseApply configuration changes:
sudo gitlab-ctl reconfigureNavigate to:
http://your-server-ip
Set the root password and log in with:
- Username:
root - Password: Auto-generated during installation and saved under
/etc/gitlab/initial_root_password(valid for 24 hours).
- Create a project named
ansible - Initialize with a
README.md - Clone the repo:
git clone http://your-server-ip/root/ansible.gitReplace the URL with your actual GitLab project path if different. If Git is not installed, run:
sudo apt install git -y
cd ansible
nano playbook.ymlSample playbook:
- name: Test Ansible
hosts: localhost
tasks:
- name: Debug message
ansible.builtin.debug:
msg: "I'm Ansible"Install and run linter:
sudo apt install ansible-lint
ansible-lint playbook.ymlIf you're using Git for the first time, configure your identity:
git config --global user.name "User Name" git config --global user.email "your_email@example.com"
git add .
git commit -m "Init"
git push