Make your Mastodon account discoverable on your Ghost domain

Use your own hostname as an alias to your Mastodon account.

Make your Mastodon account discoverable on your Ghost domain
Mastodon is a free, open-source project for running social networks.

If you're heading to the Fediverse, you might be wondering, "With all of the ActivityPub servers out there, how do I ensure that people can find me?  What if I move servers?  Can I use my own domain as an address without standing up a Mastodon instance?"  The answer is yes you can, thanks to a protocol called WebFinger.  Maarten Balliauw published a blog post that explains how this works, and I recommend reading his detailed explanation.  In brief, you need to put a file on your web server under the /.well-known/webfinger path that contains the location of your Mastodon server and your account name.

I use Ghost for my blog, I thought it would be useful to show you how to add this file to a self-hosted Ghost instance:

  1. Log into the server where you are running Ghost.
  2. Confirm that Nginx is set up to serve files from the /.well-known URL path:
    1. cd /etc/nginx/sites-available
    2. less where "" is your site's hostname
    3. Verify that the config file contains location - /.well-known { ... }
    4. Note the file location next to root for the next step
    5. Hit q to get back to the shell
  3. Create the .well-known directory by running sudo mkdir /var/www/example_com/system/nginx-root/.well-known where the path is the root location from your Nginx config plus .well-known.
  4. Download the WebFinger file for your account on your favorite Mastodon server by running curl -v '' > /tmp/webfinger, replacing "yourname" with your username on the Mastodon server and "" with the hostname of your Mastodon server.
  5. Move the file to the .well-known directory: sudo mv /tmp/webfinger /var/www/example_com/system/nginx-root/.well-known,
  6. Verify that your host is returning the WebFinger file by opening in a browser.
  7. Head to a Mastodon server and search for your account name, but using the hostname of your Ghost blog, e.g. "". You should see the account from the Mastodon server got the WebFinger file from.

Now you can move freely through the Fediverse without constantly updating your account name every time you change servers.  Find me, now and forever, at