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~/binis in your path (for example by editing your.bashrcfile) - Download the
forgejo.servicescript to~/.config/systemd/user. - Create the following folders:
~/var/lib/forgejo~/etc/forgejo
- Download forgejo to
- Edit the
forgejo.servicescript 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/forgejois replaced by/home/my_username/bin/forgejo/var/lib/forgejois replaced by/home/my_username/var/lib/forgejo/etc/forgejois replaced by/home/my_username/etc/forgejo
- Include the
--userswitch in all invocations ofsystemctl.systemctl --user enable forgejo.servicesystemctl --user start forgejo.service
- Run
loginctl enable-linger $USER(this will keep forgejo running even if you log out or reboot)