Logo       PBase-Foundation


Here is how to install the Mastodon federated messaging platform. It provides a PostgreSQL database backend. It assumes your host is registered in DNS. The installer will use Let's Encrypt to setup HTTPS.

After running the first two preconfig packages be sure to modify the configuration files in the /usr/local/pbase-data/admin-only/module-config.d/ directory.

Specifically, the pbase_lets_encrypt.json must be changed to hold your site administrator's email address. And the pbase_smtp.json file must be changed to hold your outgoing SMTP email server information.

yum -y install https://pbase-foundation.com/pbase-preconfig.rpm
yum -y install pbase-preconfig-postgres-mastodon
yum -y install pbase-postgres
yum -y install activpb-mastodon

Compatibility: EL8/CentOS 8 only
Note: On Red Hat EL 8 you must first enable CodeReadyBuilder repo with:
subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms


You should secure your server with pbase-firewall-enable, sync your clocks with pbase-timesync-enable for ActivityPub if your server doesn't already have NTP, and lock down SSH access with the pbase-ssh-fail2ban package.

yum -y install pbase-ssh-fail2ban
yum -y install pbase-timesync-enable
yum -y install pbase-firewall-enable

Configuration Options

The pbase-preconfig-postgres-mastodon package places default option files under the /usr/local/pbase-data/admin-only/module-config.d/ directory.

This is the Mastodon configuration options file. These defaults are appropriate for most use cases.

"activpb_mastodon" : {
"port": 3000,
"addNgnixProxy": true,
"subDomainName": "",
"webDomainName": "",
"alternateDomains": "",
"singleUserMode": false,
"authorizedFetch": false,
"limitedFederationMode": false

(Limitations: the addNgnixProxy, subDomainName, and alternateDomains fields are not implemented in 1.0)

This is the Let's Encrypt configuration options file. Be sure to set the emailAddress. If your server is not registered in DNS you should set executeCertbotCmd to false.

"pbase_lets_encrypt" : {
"enableAutoRenew": true,
"executeCertbotCmd": true,
"additionalSubDomain": "",
"emailAddress": "yoursysadmin@yourrealmail.com"

(Limitations: the additionalSubDomain field is not implemented in 1.0)

This is the SMTP configuration options file. The defaults are typical for a Mailgun client.
Be sure to set the password field with the correct value from the SMTP provider.

"pbase_smtp" : {
"server": "smtp.mailgun.org",
"port": 587,
"login": "postmaster@mail.example.com",
"password": "mysmtppassword",
"authMethod": "plain",
"openSSLVerifyMode": "none"

This is the Postgres configuration options file. The defaults are typical for a standalone Mastodon server stack with a local Postgres server and generally will not need to be modified.
But for an external database server this must be edited to point to it.

"pbase_postgres": [
"default": {
"hostName": "localhost",
"port": "5432",
"startService": true,
"enableRemoteAccess": true,
"install": true,
"database": [
"name": "mastodon_production",
"user": "mastodon",
"password": "mypostgrespassword",
"grantCreateDatabase": true

(Limitations: only one database at a time the startService, enableRemoteAccess, and install fields are not implemented in 1.0)

This is the S3 storage configuration options file. To use S3, set the s3Enabled to 'true' and fill in the rest of the values as documented in:

"pbase_s3storage" : {
"s3Enabled": false,
"s3Bucket": "",
"awsAccessKeyId": "",
"awsSecretAccessKeyId": "",
"awsS3RegionName": "",
"awsS3AliasHost": "",
"awsS3HostName": ""