mullane.info

Running GitLab in rootless Podman on Arch

Undated · gitlab

Everything about the house network lives in git: the firewall plan, every server’s notes, the shared scripts. In late October I had the agent set up a GitLab server on a VM to hold all of it, with sign-in through our own identity server. The servers here all run Arch Linux, and GitLab’s usual package doesn’t support Arch. Arch does have its own gitlab package, but that means assembling about six services by hand. So it runs the official GitLab image under rootless Podman, as a systemd Quadlet, which matches how the other services in the house run. First start takes about seven minutes (configuration plus database migrations) and it settles at around 3.6 GB of RAM, which is a lot for a git server, but GitLab has never pretended to be small.

The first surprise was that it started by itself before it was ready. The plan was to put the TLS certificate in place and then start GitLab. But the service user’s systemd instance (kept running with lingering) starts any unit that’s wanted by its default target as soon as the Quadlet file is generated, so GitLab was up before the certificate existed. Its configuration step failed and retried in a loop until the certificate arrived, and then it healed on its own. No harm done, but “the setup script won’t start it yet” turned out not to be something to rely on.

The second was backups. The first gitlab-backup run failed with two messages that didn’t obviously belong together: one about database.yml being a symlink to nothing, the other saying the data directory wasn’t writable. The cause was the folders on the host that are mounted into the container. They were mode 750, and GitLab runs several of its parts as different, non-root users inside the container, which need to be able to traverse into the data directory. Setting those two folders to 755 fixed both errors; the parent folder stays 750, so nothing outside the service account can get in.

Sign-in with the identity server failed next, with “Could not authenticate you from OpenIDConnect because ‘The request is otherwise malformed’”. GitLab’s side said nothing more useful than that. The identity server’s log did: “Invalid grant_type for provider”. In the 2026 versions of Authentik, an OAuth2 provider’s list of allowed grant types has to be set explicitly, and an empty list allows nothing at all. Setting it to authorization code and refresh token fixed it. The habit worth keeping is to read the identity provider’s log first, since the application only ever shows the generic error.

Two last details. The free edition of GitLab can’t make someone an admin based on their groups in the identity server (that’s a paid feature), so after my first single sign-on login the agent promoted my account from the Rails console and then turned password sign-in off for the web. And the first-run root password is generated on the VM. The agent’s permission check refused to copy it into the secrets folder, so I read it myself on the VM and then it was shredded. That seemed fair enough, since it was only ever needed once.