Skip to content

Instantly share code, notes, and snippets.

@cjtallman
Last active February 24, 2024 01:12
Show Gist options
  • Save cjtallman/b526d8c7d8b910ba4fd41eb51cd5405b to your computer and use it in GitHub Desktop.
Save cjtallman/b526d8c7d8b910ba4fd41eb51cd5405b to your computer and use it in GitHub Desktop.
Vagrant Gitlab Server

Vagrant Gitlab Server

Quickly set up a local Gitlab CE server using Vagrant.

Run vagrant up to setup the virtual server.

Server Details

echo ==== Installing Requirements ==============================================
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y curl openssh-server ca-certificates postfix
echo ==== Installing GitLab CE =================================================
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install -y gitlab-ce
sudo gitlab-ctl reconfigure
sudo gitlab-ctl status
echo ==== Installing GitLab Multi Runner =======================================
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash
sudo apt-get install -y gitlab-ci-multi-runner
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.hostname = "gitlab.local.dev"
config.vm.network :private_network, ip: "33.33.33.33"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.provider "virtualbox" do |vb|
vb.name = "GitLab Server"
vb.memory = "2048"
vb.cpus = "2"
end
config.vm.provision :docker
config.vm.provision "shell", path: "install_gitlab.sh"
end
@macmichael01
Copy link

For the latest Ubuntu, change:

config.vm.box = "generic/ubuntu2004"

To fetch the root user password

vagrant ssh
sudo vim /etc/gitlab/initial_root_password

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment