ObjectiveInstall Gitlab on Debian 9 Stretch
DistributionsDebian 9 Stretch
RequirementsA working installation of Debian Stretch with root access.
- # - requires given command to be executed with root privileges either directly as a root user or by use of
- $ - given command to be executed as a regular non-privileged user
IntroductionGitlab is an awesome free software alternative to Github. It allows teams and individual developers to host and manage their own projects on servers that they control. Debian Stretch provides a stable foundation for Gitlab and can make for an excellent code repository server. Plus, Gitlab's Omnibus Package makes installation super simple.
Install The DependenciesThere are a couple of dependencies that you need to install on Debian before you can set up Gitlab. The only thing that might seem out of the ordinary is Postfix. Gitlab uses it to send emails about the repository. During the install, Postfix will ask you which type of configuration to use, select "Internet Site."
# apt install curl openssh-server ca-certificates postfix
Add The Repository and InstallGitlab provides a convenient script that adds the Gitlab repository to Debian and installs Gitlab. Grab the script with
curland run it as root.
#curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | bashWhen the script finishes, you can install Gitlab with
# apt install gitlab-ce
Reconfigure And Start
gitlab-ctlis the command line utility that you'll use to manage Gitlab. In this case, you need to use it to generate your configuration.
# gitlab-ctl reconfigureThe script will run and set up your configuration for Gitlab. It will also start up Gitlab when it's done. In the future, when you want to start and stop Gitlab, you can use the following commands.
# gitlab-ctl start # gitlab-ctl stop
First Run And Setup
Since Gitlab is running, browse to your server's IP or domain name in your browser. Gitlab will greet you with a screen asking you to create a password for your administrative user. For now, that user is called "root," but you can change it when you log in.
After you enter your new password, Gitlab will ask you to log in. Enter your login credentials and you'll gain access to the admin panel of Gitlab. There are a ton of options there. It's best if you take a look around and explore. It should look somewhat familiar to you if you're used to Github.