Setup new Gitlab instance with external data directory for repository storage - Please help

Hi all,

I installed a Gitlab instance on Ubuntu Server a few weeks back and since then have been battling with trying to change the data_dir to use an SMB share on a TrueNAS server, since the OS only has a 20GB disk.

I’ve failed miserably. I couldn’t figure out how to get the permissions right. I’m not sure it’s even possible now, looking deeper at the docs.

I am going to bin this instance now and I would like to set up a new one. I need to set this up with external storage for the data in mind. The external storage is a TrueNAS server and I can set up various types of shares, SMB, NFS, iSCSI, S3.

Looking at the docs it’s not immediately clear to me if any kind of external storage is even supported anymore. I see lots of mentions of Gitaly when looking up external storage but I’m not seeing any clear documentation on how to use that and how exactly it works. I must be overlooking it.

From what I understand there is a Gitaly instance installed with Gitlab. How can I configure the Gitaly node to use my external storage for all the data/repositories and get this setup how I want. Is it even possible?

Any help or advice would be greatly appreciated.



Hi @fsociety3765
There is NFS support, but that won’t be supported with GitLab 14. It is being replaced by Gitaly Cluster, but I don’t think that helps you in any way. There is possibility to run Gitaly on it’s own, but you probably can’t install it on the TrueNAS.
Other than that there is no support for external storage for repositories that I know of.

You could still run NFS, though. If you can support it yourself. Whatever you mount in OS under (for Omnibus) /var/opt/gitlab will be used. It depends on your performance requirements.


Thanks for the advice.

I think I may have found a solution to make this work… Not sure. I thought of it myself.

If my understanding is correct, a Gitaly node is just another server running a Gitlab instance but with no external URL. Is that right? If so, what I have done may work. I have set up three separate Gitaly nodes directly on my TrueNAS server, each inside its own Jail (a FreeBSD container basically). I used the instructions on the Gitlab website to get it installed on FreeBSD. I haven’t installed any database in any of them as I am not sure that is required on the Gitaly nodes directly. I understand a separate server for PostgreSQL is required though, as well a proxy node and load balancer. I plan to run these on regular Ubuntu servers.

Do you have a lot of experience with or understanding of setting up Gitaly clusters? Will, what I am doing with my limited understanding work?



Gitaly server is just running Gitaly from the GitLab Omnibus installation bundle.

It depends on your needs, but having 3 instances on a single physical server doesn’t look like it brings any benefits.
You can just deploy single Gitaly server like it is explained in this page and point GitLab to it.
In this scenario everything from GitLab except Gitaly runs on your Ubuntu server and Gitaly is external. You don’t need additional database for Gitaly.

I don’t have experience setting up Gitaly Cluster :frowning:


In that case, I may be good to go with just a little configuration. I have the Gitlab instance installed in Ubuntu again now. Currently I have done the install and confirmed I can access it in a web browser. I haven’t actually logged in or done any further setup on it other than that. And I have three Gitaly nodes setup in FreeBSD containers on TrueNAS. I can just disable two of them.

At this point surely it’s just a case of editing the config file on Gitlab to point to the Gitaly node for storage?Are there any specific docs on how to do that?


Here a complete guide from how to setup Gitaly server to how to setup GitLab instance: