How do you accidentally have a mastodon server?

Well it starts by thinking you did it wrong, and then it turns out you were just impatient.

It feels a little late to the bigger migrations that happened at the tail end of 2022, but I’m glad that I waited until I had time this past spring to set up my own mastodon instance. I have really been enjoying the sense of community there, it really feels like the early Internet back when we all used forums.

Waiting got me a couple of things – first, since everyone wants a mastodon instance now, setting one up is even more of a solved problem.

I ended up using the Linode marketplace to great effect.

However, when I first tried accessing my service, every page gave me a 403 error and I couldn’t get any emails to send for things like registering accounts.

I referenced Chris Hubbs’ website back when I was trying to troubleshoot:

Based on my command history, I spent some time evaluating if it were a permissions issue to certain directories, but I’m not confident this was the case in retrospect since Linode’s mastodon install is via Docker and all of those files also exist within the Docker filesystem. I instead think there were some tasks that hung up because I kept restarting the host and that once some hours had passed things were fine.

There are some emails timestamped for some time after I had given up and set the project aside for a moment – it is unclear whether it is simply long minutes or multiple hours but in any case, they started arriving in early-mid April. As I was on something of an out of office break after getting a permanent position secured, I didn’t see them until weeks later.

You’d take the time to be able to freely ignore your inbox too if you could!

   25  less /var/log/nginx/access.log
   26  ls
   27  cd home
   28  ls
   29  ll mastodon
   30  ls -l
   31  cd mastodon
   32  ls
   33  ls -l
   34  cd live
   35  ls
   36  ls -l
   37  chmod o=rx /home/mastodon/*
   38  ls -l
   39  chmod -r  o=rx /home/mastodon/*
   40  chmod o=rx /home/mastodon/*
   41  chmod -R o=rx /home/mastodon/*
   42  ls -l
   43  tail -f /var/log/nginx/access.log
   44  ls
   45  less /etc/nginx/nginx.conf
   46  less /etc/nginx/
   47  less /etc/nginx/sites-enabled/

And that’s how was made…

I’ve had as a domain for years now, since I really like dinosaurs and other prehistoric reptiles like plesiosaurs. As an adult, I’ve learned that tons of discoveries have been made since I was first fascinated as a child. So even though the domain isn’t strictly paleontology oriented, it’s meant for things that fascinate and get people engaged in the world around them. So I’m glad I’m finally using the domain and that the service actually works!

Of course, I like to write nice long posts.

Once I realized the server was working, I raised the post character limit and confirmed it was raised via API but immediately after doing so it did not appear raised in web interface.

Rebuilding mastodon in containerized environment

While editing the files in place clearly works and shows as working as an API response, the javascript compose form file did not update in place.

I was following a guide here, but I ended up needing to reference some additional resources to figure out how to get these changes to persist in the frontend environment.

Additional reources:

The correct answer was to remove the built asset files (clobber) and rebuild from scratch. This forced the react app to redeploy cleanly.

mastodon@195f7f84ba5d:~$ rails webpacker:clobber
Removed webpack output path directory /opt/mastodon/public/packs
mastodon@195f7f84ba5d:~$ bundle exec rails assets:precompile
yarn install v1.22.19
[1/6] Validating package.json...
[2/6] Resolving packages...
success Already up-to-date.
Done in 1.66s.
Compiled all packs in /opt/mastodon/public/packs
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly:

Command history:

ENV RAILS_ENV="production" \
    NODE_ENV="production" \

# Set the run user
USER mastodon
WORKDIR /opt/mastodon

# Precompile assets
RUN OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder rails assets:precompile && \
    yarn cache clean
A screenshot of a browser inspection console showing the front end of a mastodon instance has not had its post character limit increased past 500.
A screenshot of the API response from a mastodon instance showing the post character limit has been increased to 5000
A screenshot of a terminal window showing the progress of running the following command `RAILS=ENV=production bundle exec rails assets:precompile`
A screenshot of a terminal window showing the progress of running the following command `RAILS=ENV=production bundle exec rails assets:precompile`
A screenshot of the light mode mastodon instance compose post UI showing the character count has been increased to 5000

And so, I’ve had a working Mastodon instance since May ninth. I’m already meeting plenty of interesting people and discovering all kinds of great alternatives to juggernaut platforms!

Thank you for reading. Please let me know if there are any clarifications I can make or further questions I can answer either down in the comments, on LinkedIn, or hit me up on Mastodon.

Related Posts