How to Install Mastodon on OpenSUSE Latest?

Mastodon is a free, decentralized and open-source social media platform that enables users to create and manage their own Mastodon instance. If you want to set up your own Mastodon instance on OpenSUSE Latest, follow these steps:

Prerequisites

Before proceeding with the installation, make sure you have the following prerequisites in place:

Step 1: Install Docker and Docker Compose

Mastodon requires Docker and Docker Compose for its installation. Run the following commands to install Docker on your server:

sudo zypper install docker
sudo systemctl start docker
sudo systemctl enable docker

Next, install Docker Compose by running the following command:

sudo zypper install docker-compose

Step 2: Clone Mastodon repository

Now, clone the Mastodon repository to your server by running the following command:

git clone https://github.com/tootsuite/mastodon.git

After the cloning process is complete, navigate to the Mastodon directory:

cd mastodon

Step 3: Configure Mastodon

Mastodon requires some configurations to be made. Copy the example configuration files:

cp .env.production.sample .env.production

Edit the .env.production file and set the following parameters:


LOCAL_DOMAIN=yourdomain.com # Replace yourdomain.com with your server's domain name.
SECRET_KEY_BASE=your_secret_key # Generate a secret key using `openssl rand -hex 64`.
DB_PASSWORD=your_db_password # Set a strong database password.

Step 4: Start Mastodon

Now, start Mastodon using Docker Compose:

docker-compose up -d

It will take some time for Mastodon to start up.

Step 5: Create Admin Account

After Mastodon is installed, create an admin account by running the following command:

docker-compose run --rm web rails db:seed_fu

Provide the required details to create an admin account.

Step 6: Configure Firewall

Finally, configure the firewall to allow incoming connections to ports 80 and 443 for HTTP and HTTPS traffic, respectively:

sudo firewall-cmd --add-port=80/tcp --permanent
sudo firewall-cmd --add-port=443/tcp --permanent
sudo firewall-cmd --reload

You have now successfully installed Mastodon on your OpenSUSE Latest server. You can access your Mastodon instance by visiting http://yourdomain.com.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!