Setting up Forgejo without root access / running under a single user. I devised these steps to deploy Forgejo on a Dreamhost VPS which only provided an SSH user.
- Create user folders and install forgejo to use these rather than system paths.
- Download forgejo to
~/bin/forgejo
. Make sure~/bin
is in your path (for example by editing your.bashrc
file) - Download the
forgejo.service
script to~/.config/systemd/user
. - Create the following folders:
~/var/lib/forgejo
~/etc/forgejo
- Download forgejo to
- Edit the
forgejo.service
script to run under the current user.- Delete the lines assigning User and Group.
- Edit the lines assigning WorkingDirectory, ExecStart and Environment to use your revised local paths. These must be absolute, and include your username:
/usr/bin/forgejo
is replaced by/home/my_username/bin/forgejo
/var/lib/forgejo
is replaced by/home/my_username/var/lib/forgejo
/etc/forgejo
is replaced by/home/my_username/etc/forgejo
- Include the
--user
switch in all invocations ofsystemctl
.systemctl --user enable forgejo.service
systemctl --user start forgejo.service
- Run
loginctl enable-linger $USER
(this will keep forgejo running even if you log out or reboot)