I’m running Coolify on Vultr. Having done this before, I know that Gitea can use a lot of disk space, especially if working with docker containers.
I prefer using low budget VPS, so that means about $10 a month. Problem there, those budget VPS come with a small disk of about 55GB. This size gets filled up pretty quick when using Gitea as a docker registry.
Ok so we need a bigger disk. On Vultr, this is no problem, we just need to attach a block storage.
On Vultr, we can get a 512GB HDD for $12.5/month
Be sure to follow the steps to attach the blockstorage to the VPS. My VPS is called, “regira.” I used Coolify’s web UI to go to Server > regira > Terminal and after connected, I followed Vultr’s quick start guide. It’s as simple as copy-pasting each of the following commands to partition the blockstorage and mount it to the VPS.
The first block storage device is connected to your server as /dev/vdb. Additional devices will be relabeled ( /dev/vdc, /dev/vdd, and so forth). By default, we do not create any filesystems on block storage volumes.
Linux Quickstart Example
If you are mounting an existing volume with data, do not create partitions or filesystems. All data will be lost. Vultr does not back up Block Storage. Make sure you have a backup before making any changes to block storage volumes.
Create new empty partitions:
parted -s /dev/vdb mklabel gpt
parted -s /dev/vdb unit mib mkpart primary 0% 100%
Create new empty filesystem:
mkfs.ext4 /dev/vdb1
Mount the volume after it has been prepared.
Mount block storage:
mkdir /mnt/blockstorage
echo >> /etc/fstab
echo UUID=$(blkid -s UUID -o value /dev/vdb1) /mnt/blockstorage ext4 defaults,noatime,nofail 0 0 >> /etc/fstab
mount /mnt/blockstorage
After running those commands, Ubuntu suggested I run systemctl daemon-reload so I did that. This command updates the system to run the latest configurations that we just made.
Next we need to tell docker to use the blockstorage for it’s data. If we skip this step, docker will not write to our blockstorage and instead it will fill up our system disk. This step is essential.
We edit /etc/docker/damon.json and configure docker to put it’s data root on the blockstorage. I used mg in the Terminal, but you can use nano or vi or whatever editor you prefer. This way, volumes get created in this sub-directory, rather than the usual directory of /var/lib/docker.
// /etc/docker/daemon.json
{
"data-root": "/mnt/blockstorage/docker"
}After saving, we need to restart docker on the server. I went back to the terminal and ran systemctl restart docker
Configuring gitea on Coolify
Next we need to configure the docker compose volumes, so Coolify puts our gitea data in a consistent place for us to access. This is important because we will need to have gitea’s app.ini in a folder that we can get to and edit.
If we want to use gitea’s default configuration, we can skip this step. But if you need to edit any values in gitea’s app.ini, this step is important.
We’re starting with the gitea project which can be found in Coolify’s public resources list. Then, we go to General > Edit Docker Compose, and make sure services.gitea.volumes looks like the following.
volumes:
- 'gitea-timezone:/etc/timezone:ro'
- 'gitea-localtime:/etc/localtime:ro'
- '/mnt/blockstorage/gitea:/data/gitea'Deploying gitea
Now that our VPS and gitea are configured, we can deploy gitea by pressing the Deploy button in Coolify’s web UI.
Once this is complete, you will need to finish setting up gitea using it’s web UI. This is where you configure an administrator account.
After gitea is installed, your app.ini will be accessible on the VPS at /mnt/blockstorage/gitea/data/gitea/conf/app.ini. Edit this file in the terminal to configure to your needs. See https://docs.gitea.com/next/administration/config-cheat-sheet#service-service for more info on editing gitea config.