Using the Mastodon container and having issues federating and interacting with with other instances (perhaps a webfinger issue?)

Hello! I’m using the linuxserver/mastodon Docker container. It is running on my own private server with Rocky Linux 8.6. My problem is that the Mastodon server is up and running a-ok but isn’t able to federate with other Mastodon instances - it can’t “find” and doesn’t “know about” any other Mastodon instances, so messages to/from other servers don’t work, I can’t follow individuals in other servers, etc.

I believe the issue is that the webfinger is either not set-up on my server (or is it the container??) or doesn’t work. I have done some googling and poking around and it seems like there needs to be some /.well-known/webfinger directory somewhere or webfinger needs to be set-up as that is how Mastodon passes information between instances. I have never used webfinger and unfortunately know very little about it.

I have only some experience with systems administration with Linux and much much less experience using and running Docker containers, so apologies in advance if I am missing something useful or obvious! I am stuck and hoping for help. Are there any suggestions or troubleshooting methods I should be trying?

Extra info:

Container: image: lscr.io/linuxserver/mastodon:latest

Relevant error messages or logs: provided below is a sample error when sending a message to another instance outside of my own Mastodon instance (error copied from the Sidekiq interface under Retries)

Queue: Push
Job: ActivityPub::DeliveryWorker
Error: Mastodon::UnexpectedResponseError: https://astrodon.social/inbox returned code 401

Environment: Rocky Linux 8.6

Docker Compose File:

version: '3'
services:
  db:
    restart: always
    image: postgres:14-alpine
    shm_size: 256mb
    networks:
      - internal_network
    healthcheck:
      test: ['CMD', 'pg_isready', '-U', 'postgres']
    volumes:
      - /home/[redacted]/postgres14:/var/lib/postgresql/data
    environment:
      - 'POSTGRES_DB=[redacted]'
      - 'POSTGRES_USER=[redacted]'
      - 'POSTGRES_PASSWORD=[redacted]'

  redis:
    restart: always
    image: redis:7-alpine
    networks:
      - internal_network
    healthcheck:
      test: ['CMD', 'redis-cli', 'ping']
    volumes:
      - /home/[redacted]/redis:/data
      
  mastodon:
    image: lscr.io/linuxserver/mastodon:latest
    env_file: 
      - stack.env
    depends_on:
      - db
      - redis
    volumes:
      - /home/[redacted]/config:/config
    ports:
      - 8081:80
      - 8444:443
    networks:
      - external_network
      - internal_network

networks:
  external_network:
  internal_network:
    internal: true

Hey all! I figured this out. The problem had absolutely nothing to do with the Mastodon Docker container!

The issue was that I use Webmin to manage a lot of my Linux server and the server itself runs Apache web server. When I had created a subdomain for this Mastodon instance to live via Webmin, Webmin automatically created a few re-directs in my global Apache configuration file for /.well-known addresses to the domain.

I commented out those redirects and voila! My Mastodon instance federates as-expected.

As the LSIO instance runs on our container, we never suspected it was a container issue! We’re glad you solved your problem either way though.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.