# GitLab

Run GitLab on your own server: safe upgrades, settings, restarts, checks, backups with their secret files, and runners.

When GitLab is installed on a server, the server's menu gets **Code hosting** (technical name: GitLab). A Basic server that runs GitLab is shown as a **GitLab server**.

GitLab needs at least 4 GB of memory, and keeps about 3 GB of it for itself: Recommended settings sizes PHP and the databases of the server for what is left. The page compares what GitLab uses with what the server can really use, and warns when the server is too small.

## Its address

GitLab is installed with its plain `http://` address, so it works while the address of its site gets ready. When HTTPS is turned on for that address, or the address changes, GitLab is given the new one by itself: a task named **Give GitLab its new address (takes a few minutes)** writes it as `external_url`, tells GitLab that visitors arrive over HTTPS through the server's web server, and applies the settings. GitLab is unreachable for a few minutes meanwhile; if it does not answer afterwards, the previous settings come back. An address you set yourself on the **Settings** tab for another name is kept as it is.

## Overview

The overview shows the version and edition, the address, the memory GitLab uses, and each of its parts (web, background jobs, database, Git storage and the others) in plain words: running, stopped or failing. Each part's **⋮** menu restarts it, and the web part can be reloaded without cutting visitors off.

### Upgrades

GitLab must be upgraded through specific versions, called required stops: an upgrade that skips one breaks the instance. Fuzops offers only the **next allowed version**, worked out from GitLab's own list of required stops and the versions GitLab publishes for your server.

- A newer patch of your version comes first.
- Then the next required stop, at its newest patch.
- When no stop is left before the newest version, the newest version.

An upgrade is never automatic: you start it, a backup is made first (ticked by default, and the upgrade does not start if the backup fails), and GitLab must answer afterwards. Wait for the background migrations shown on the overview to finish before the next upgrade.

## Settings

The **Settings** tab is a form for the common options of `gitlab.rb`:

- the address of GitLab (HTTPS is set on the address's **Domain and HTTPS** page; GitLab then follows it by itself, see [Its address](#its-address)) and the time zone;
- who may create an account;
- outgoing email through your email provider, with **Send test**;
- the container registry and Pages, each with its own address;
- the backup folder and how many days backups are kept;
- memory: web workers, background threads and GitLab's own monitoring, with values suggested for the memory of your server.

The whole file can be edited too, with passwords and secrets hidden: they stay on the server. The lines that let Fuzops reach GitLab cannot be changed.

Saving checks the file, keeps a copy, then runs **Apply GitLab settings** (`gitlab-ctl reconfigure`), which takes a few minutes. GitLab is unreachable for one to a few minutes meanwhile. If GitLab does not answer afterwards, the previous file comes back and is applied again. Earlier versions can be put back.

## Controls and check

**Apply GitLab settings** and **Restart all of GitLab** are on the **Controls and check** tab. **Check GitLab** (`gitlab-rake gitlab:check`) runs GitLab's own checks and shows the result in plain words, with what GitLab printed one click deeper.

## Backups

**Back up now** makes a GitLab backup (repositories, database and uploads), and **Back up every night** adds a nightly job to **Scheduled jobs**. Each backup comes with the two secret files a restore needs, `gitlab.rb` and `gitlab-secrets.json`, saved in `/etc/gitlab/config_backup`.

> **Warning:**
> A GitLab backup cannot be restored without those two secret files. Keep a copy of both away from the server: add a file backup of the two folders shown on the page to your team's backup destination on the **Backups** page.

Restoring replaces everything GitLab holds, so Fuzops shows GitLab's documented steps with this server's folders and does not run them for you.

## Runners

The **Runners** tab lists the runners registered with GitLab, their state and when they last contacted it. Each one can be paused, resumed or removed. Installing a runner is done on the machine that runs it, with a token from GitLab's admin area.

## Administrator sign-in

Owners and Admins can show the password of GitLab's first administrator (`root`), which Fuzops made when it installed GitLab, and set a new one. The new password is shown once, and kept on the Services page.

## Plans

Seeing everything on this page is on every plan. Managing GitLab (settings, controls, backups, upgrades, runners) is part of **Pro** and **Business**, like installing it. On Starter, GitLab itself can still be started, stopped or removed on the Services page.

## Related

- [Services and tools](https://internal.fuzops.com/docs/services)
- [Backups](https://internal.fuzops.com/docs/backups)
- [Background processes and scheduled jobs](https://internal.fuzops.com/docs/background-processes-and-scheduled-jobs)
