How I set up my own Mastodon server and custom display name


I was curious about Mastodon but only interested in joining if I could have the name I wanted: The promise of open source is control and customizability, is it not?

I already had a personal website at hosted on GitHub Pages. Rather than rent a new domain, I set up my own Mastodon instance on a subdomain, Then, I changed my display name from to by setting up HTTP redirects and editing my Mastodon .env file.

I’ll describe my process in more detail in case it helps anyone else.


I wanted to:


The general stages were:

  1. Set up hosting
  2. Connect my domain
  3. Set up Mastodon
  4. Fix my admin privileges
  5. Set up a custom domain

setting up hosting

For hosting, I chose DigitalOcean because of its reputation. Setting up my Mastodon instance required creating a new Droplet.

To create the Droplet:

  1. Create DigitalOcean account (here’s my referral link if you care to use it).
  2. Begin a new Droplet.
  3. Choose a region and datacenter.
  4. Go to Marketplace, search for Mastodon, and choose it. Search result for mastodon returns Mastodon 4.0.2 on Ubuntu 20.04
  5. Choose size. I chose the most basic option, as I’ll be the only user on my instance. For “Additional Storage”, I didn’t opt in.
  6. Choose authentication method. I read Mastodon requires SSH, not password. I set up an SSH key on my Mac via Terminal.
  7. For the final settings, I opted into monitoring but not backups. I didn’t change the hostname or project from the defaults.
  8. Choose Create Droplet. The Droplet will take a few minutes to be ready.

linking a subdomain

I had and wanted to set up on rather than rent another domain and fragment my domain architecture. This guide assumes you already have a domain—e.g.,—and you want to set up your Mastodon server on a subdomain—e.g.,

  1. Go to your domain name provider or registrar. Mine is Google Domains.
  2. Find your DNS settings and resource records.
  3. Create a new record A record for Set type to A and host name to your chosen subdomain—e.g., just social. I didn’t change the default TTL.
  4. Go back to DigitalOcean. When your Droplet is ready, copy its IP address.
  5. Paste the IP address into the A record.

going through the mastodon setup wizard

Now that I had the Droplet and domain connected, I could go through the setup of the Mastodon app on the Droplet.

  1. Open a command line. For me, this was via Terminal on Mac.
  2. SSH into the Droplet by typing ssh root@[your Droplet’s IP address] and hitting enter. Example results:
    Users-iMac:~ user$ ssh root@##.###.###.###
    The authenticity of host '##.###.###.### (##.###.###.###)' can't be established.
    ECDSA key fingerprint is […].
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added ##.###.###.###' (ECDSA) to the list of known hosts.
    Enter passphrase for key '/Users/user/.ssh/id_rsa':
  3. Enter your SSH passphrase.
  4. Go through the wizard. For example:
    Welcome to the Mastodon first-time setup!
    Domain name:
    Do you want to store user-uploaded files on the cloud? No
  5. Set up SMTP if you’d like. I skipped it (I actually tried a test email to see what would happen; it failed):
            SMTP server: localhost
            SMTP port: 587
            SMTP username:
            SMTP password:
            SMTP authentication: plain
            SMTP OpenSSL verify mode: none
            E-mail address to send e-mails "from": Mastodon <>
            Send a test e-mail with this configuration right now? no
  6. Create an admin account. For example:
    It is time to create an admin account that you'll be able to use from the browser!
    Username: Name
    You can login with the password: […]
    The web interface should be momentarily accessible via
  7. Save that password somewhere.
  8. Go through the final SSL notification items: enter an email address and choose whether to donate to EFF. When SSL and symlinks are ready, the wizard will say Setup is complete! Login at
  9. Visit your and log in with the email and password from action 19.
  10. You can set a password different from the generated one.
  11. Go to Preferences and verify you have Administration privileges. You can also verify you can visit https:/ without error: Administration tab underneath Moderation tab

fixing my admin privileges

When I logged into my instance, I didn’t have an Administration tab. I changed my account role to Owner by entering my Mastodon instance via Terminal and using a tootctl command.

Instead of using Terminal, you can also use the console in DigitalOcean near the top right of the web interface of your Droplet. This console is now my preferred way of entering my instance, rather than SSHing in on my computer.

  1. Install Ruby at the Droplet root. I’m not sure if this was necessary, but I was following a GitHub thread.
    root@hostname:~# apt install ruby ruby-bundler
  2. Sudo into the Mastodon app.
    root@hostname:~# sudo su mastodon
  3. Change to the home directory, then to the live/bin directory.
    mastodon@hostname:/root$ cd ~
    mastodon@hostname:~$ cd live/bin/
  4. Use tootctl to change the role of your Name account to Owner. (You set Name in action 19.)
    mastodon@hostname:~/live/bin$ RAILS_ENV=production ./tootctl accounts modify Name --role Owner

Now you should have full admin privileges.

setting up a custom domain

Setting up a custom domain allows your display name to be instead of (I believe, theoretically, the display domain could be arbitrary, e.g., To display a custom domain, I set HTML redirects in GitHub Pages for three web resources: host-meta, nodeinfo, and webfinger. I also had to edit my Mastodon .env file.

  1. Curl host-meta from
    Users-iMac:~ user$ curl -k
  2. Copy the resulting XML and put it in a new GitHub Pages file called:
  3. Do the same for nodeinfo. Curl nodeinfo from
    Users-iMac:~ user$ curl -k
  4. Copy the resulting JSON and put it in a new GitHub Pages file called:
  5. Do the same for webfinger, curling and inserting into a file.
    Users-iMac:~ user$ curl -k
  6. In your Mastodon instance, change to the /home/mastodon/live directory:
    mastodon@hostname:~$ cd /home/mastodon/live
  7. Edit the .env.production file with a text editor like vim or nano:
    mastodon@hostname:~/live$ vim .env.production
  8. Add this to the top of the file, as specified by Mastodon documentation, and write the file.
  9. Exit back to the root. If you don’t, as I didn’t at first, you’ll be asked for a password until you get “3 incorrect password attempts” when trying the next sudo actions.
    mastodon@hostname:~/live$ exit
  10. Restart Mastodon services with these commands:
    root@hostname:~# systemctl restart mastodon-web
    root@hostname:~# systemctl restart mastodon-streaming
    root@hostname:~# systemctl restart mastodon-sidekiq

Now everything should be ready! Post, boost, follow at will. Follow me, even:

Thank you to the people who saved me with their advice. Here are some resources I consulted along the way:

An ambigram formed from an A and an L. It can never be upside down.

like my work?

I appreciate support of any kind, whether that’s sharing this page, telling me what you thought, or treating me to something yummy:

Venmo: @aubrie

PayPal: aubrieality