Joining the Fediverse with honk
Self-hosting a Fediverse server with honk.
One of Mastodon’s (and the Fediverse by extension) main advantages over Twitter is its decentralized nature. You can pick up and move if your instance no longer suits you. Unlike Twitter you can still interact with your Fediverse friends on other instances. While the decentralized nature offers more freedom and flexibility you still depend on someone else’s goodwill to keep the server up and running. As a techie we can do better, why not host our own?
Mastodon might be the most popular social media Fediverse platform but it’s not the only one: Pleorma, Misskey, GoToSocial, and honk all use ActivityPub under the hood to talk to each other. Honk might be one of the simplest alternatives to self-host: a single binary is all that’s needed.
First download the latest honk source code and extract the tarball.
To build honk we need a recent go compiler. The version in the Ubuntu 20.04.5 LTS repository is too old, so we are using the snap package. We also need the gcc compiler and SQLite development library. We can now build honk from within its directory.
Configure honk by setting a username and password, the listenaddr, and servername. I set
127.0.0.1:31337 as the listen address and my FQDN as server name.
From here running honk is as simple as starting the binary.
Honk does not handle encryption itself and expects a TLS frontend. We can use any webserver we like. For Apache we configure a reverse TLS proxy. Replace SERVERNAME by the FQDN used in the honk config above. The certificate is managed by certbot.
Link the config and reload Apache.
Starting the honk server manually is nice the first time but we want the system to automatically start the process after a server restart. First create a new system user so we don’t run the honk process as root.
Next add a new systemd service configuration (I stole the sandboxing part from the GoToSocial example).
All that’s left now is to enable and start the honk service.>
Check the logs to make sure everything runs smoothly.
Find me at @email@example.com and share your new fancy Fediverse instance!