Skip to content

Instantly share code, notes, and snippets.

@lupyuen
Created December 8, 2024 23:52
Show Gist options
  • Save lupyuen/f4f887ccf4ecfda0d5103b834044bd7b to your computer and use it in GitHub Desktop.
Save lupyuen/f4f887ccf4ecfda0d5103b834044bd7b to your computer and use it in GitHub Desktop.
Mastodon Docker on macOS Rancher Desktop
➜ mastodon git:(v4.3.2) ✗ $ docker exec -it mastodon-db-1 /bin/bash
8c71b639388e:/# exec su-exec postgres psql
psql (14.15)
Type "help" for help.
postgres=# CREATE USER mastodon CREATEDB;
CREATE ROLE
postgres=# \q
➜ mastodon git:(v4.3.2) ✗ $
➜ mastodon git:(v4.3.2) ✗ $ docker exec -it mastodon-web-1 /bin/bash
mastodon@948d783b7825:~$ RAILS_ENV=production bin/rails mastodon:setup
Your instance is identified by its domain name. Changing it afterward will break things.
Domain name: nuttx-feed.org
Single user mode disables registrations and redirects the landing page to your public profile.
Do you want to enable single user mode? No
Are you using Docker to run Mastodon? Yes
PostgreSQL host: db
PostgreSQL port: 5432
Name of PostgreSQL database: mastodon_production
Name of PostgreSQL user: mastodon
Password of PostgreSQL user:
Database configuration works! 🎆
Redis host: redis
Redis port: 6379
Redis password:
Redis configuration works! 🎆
Do you want to store uploaded files on the cloud? No
Do you want to send e-mails from localhost? yes
E-mail address to send e-mails "from": Mastodon <notifications@nuttx-feed.org>
Send a test e-mail with this configuration right now? no
Do you want Mastodon to periodically check for important updates and notify you? (Recommended) Yes
This configuration will be written to .env.production
Save configuration? Yes
Below is your configuration, save it to an .env.production file outside Docker:
# Generated with mastodon:setup on 2024-12-08 23:40:38 UTC
# Some variables in this file will be interpreted differently whether you are
# using docker-compose or not.
LOCAL_DOMAIN=nuttx-feed.org
SINGLE_USER_MODE=false
SECRET_KEY_BASE=...
OTP_SECRET=...
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=...
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=...
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=...
VAPID_PRIVATE_KEY=...
VAPID_PUBLIC_KEY=...
DB_HOST=db
DB_PORT=5432
DB_NAME=mastodon_production
DB_USER=mastodon
DB_PASS=
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=
SMTP_SERVER=localhost
SMTP_PORT=25
SMTP_AUTH_METHOD=none
SMTP_OPENSSL_VERIFY_MODE=none
SMTP_ENABLE_STARTTLS=auto
SMTP_FROM_ADDRESS=Mastodon <notifications@nuttx-feed.org>
It is also saved within this container so you can proceed with this wizard.
Now that configuration is saved, the database schema must be loaded.
If the database already exists, this will erase its contents.
Prepare the database now? Yes
Running `RAILS_ENV=production rails db:setup` ...
I, [2024-12-08T23:40:47.305061 #398] INFO -- : [dotenv] Loaded .env.production
Created database 'mastodon_production'
Done!
All done! You can now power on the Mastodon server 🐘
Do you want to create an admin user straight away? Yes
Username: lupyuen
E-mail: luppy@appkaki.com
I, [2024-12-08T23:41:16.740074 #175] INFO -- : [ActiveJob] Enqueued ActionMailer::MailDeliveryJob (Job ID: 0307548d-8ae7-4175-af37-821e3bc6522a) to Sidekiq(mailers) at 2024-12-09 00:41:16 UTC with arguments: "UserMailer", "welcome", "deliver_now", {:args=>[#<GlobalID:0x0000ffff548adff0 @uri=#<URI::GID gid://mastodon/User/1>>]}
You can login with the password: ...
You can change your password once you login.
mastodon@948d783b7825:~$ exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment