Running GoToSocial on NSFN

My current web host is NearlyFreeSpeech.net, which seems to be rather unique as far as hosting companies go. It’s a decidedly do-it-yourself experience1 with pay-what-you-use pricing. And while it is not true VPS hosting, you can do VPS-like things with it via daemons. As far as I know, no one has yet tried running the lightweight fediverse platform GoToSocial on it, and I am pleased to report it is entirely possible. Here’s what I did.

These are based on the bare metal installation instructions, with help from this (members-only) forum post about Etherpad and this blog post about Python/Django.

  • In the NFSN member interface, create a new site (go to the Sites tab and click the “Create a New Site” link in the right-hand sidebar). For server type, I chose “Kitchen Sink”.

  • In a terminal, ssh in to your new site with ssh $USER_$SITENAME@ssh.nyc1.nearlyfreespeech.net. (This assumes you’ve already set up SSH access. If not, you can add SSH keys from the “Profile” tab in the member interface.)

  • Navigate to your “protected” directory: cd /home/protected

  • Create folders for GoToSocial: mkdir -p gotosocial/storage Then switch to your new GTS folder: cd gotosocial. (NFSN now has SSL enabled by default, so you won’t need to make gotosocial/storage/certs. I guess you still can if you really want.)

  • NFSN uses FreeBSD, so download the latest 64-bit FreeBSD release.

    In a web browser, go to the releases page, scroll down to the table with links to binary archives for different operating systems and architectures, and copy the link to freebsd_amd64.tar.gz.

    In the terminal (remember, you should be in /home/protected/gotosocial), do wget $THAT_RELEASE_URL_YOU_JUST_COPIED.

  • Extract it with tar -xzf gotosocial_$GTS_VERSION_freebsd_amd64.tar.gz.

  • Edit the configuration file, config.yaml, as described in the installation instructions. You don’t need to bother with the LetsEncrypt-related settings, as NFSN includes TLS by default.

  • In /home/protected, create a daemon script by, for example, entering touch gotosocial.sh && nano gotosocial.sh. Whatever your file creation method, editor, or filename of choice is, the content should be this:

    #!/bin/sh
    exec /home/protected/gotosocial/gotosocial --config-path=/home/protected/gotosocial/config.yaml server start
    

    Save the file and quit (in nano, Ctrl+S and Ctrl+X respectively). Then make it executable: chmod +x /home/protected/gotosocial.sh

  • Make sure the “web” user has access to the right files and folders: chgrp -R web /home/protected/gotosocial and chmod -R g+w /home/protected/gotosocial. This tripped me up a few times around.

  • In the NFSN member interface for the site, add the daemon and proxy.

    Daemon settings:

    • Tag: gotosocial
    • Command Line: /home/protected/gotosocial.sh
    • Working Directory: /home/protected/gotosocial
    • Run Daemon As: web

    Proxy settings:

    • Protocol: HTTP
    • Base URI: /
    • Document Root: /
    • Target Port: 8080

    When stopping and restarting GoToSocial (e. g. for upgrades), stop and start the daemon via the member interface. However, you can also run the script yourself in the terminal with ./gotosocial.sh. Be very careful not to interrupt upgrades!

  • In the terminal, create your first user as described in the docs. Go to the instance URL and log in.

Troubleshooting

Logs are located in, well, /home/logs.

Cost & Performance

So far, I’m paying about $16 USD a month. I have about 1000 followers and follow about 1100 people, and when livetooting events can post quite frequently. I occasionally run into rate limits on busy #Monsterdon nights and have to lay off for a few minutes. I find in general it handles my needs fine.


I’m sure there’s a lot I’ve forgot, and I’ll probably add more about maintenance, troubleshooting, etc. In the meanwhile, if anyone else has tried this and can make suggestions to improve this guide, or has used NFSN for other fedi platforms like snac, let me know!


  1. The FAQ includes “Is your service easy to use? —No.”