I've already got a mastodon droplet, can I install Wordpress on it?

Hello! I applied for a droplet on mastodon and it worked very well. Is it possible for me to add a Wordpress on it and make it work on my subdomain? If so, how? Thank you!


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @tanzeninspace,

The Mastodon MarketPlace droplet comes with Nginx and Postgres SQL. The Nginx part is pretty straight forward however the SQL one - Postgres is not. Having said that, there are certain ways to do so.

Firstly, you’ll need to create an Nginx configuration file for your new domain. If you are uncertain how to do so, I’ll recommend using the following DigitalOcean tutorial:

As for the Postgres SQL part by default WordPress supports only MySQL and MariaDB. Having said that, there is a way to actually go around it, will use the Fork version of PG4WP. You’ll need to do something like the following (after you’ve added your Nginx configuration and pointed your domain to your droplet):

Create Database and User in your PostgreSQL

sudo su - postgres
create database your_database;
create user your_user with password ‘your_password’;
grant all privileges on database your_database to your_user;

Download WordPress

cd /var/www/WebsiteRootDirectory
tar -xzvf latest.tar.gz
rm -rf latest.tar.gz

Download and configure the Fork version of WP4PG in your WordPress directory

cd wp-content // go to wp-content
git clone
mv postgresql-for-wordpress/pg4wp Pg4wp
rm -rf postgresql-for-wordpress
cp Pg4wp/db.php db.php

Configure the wp-config.php

/** The name of the database for WordPress */
define('DB_NAME', 'your PostgreSQL database name will go here');
/** MySQL database username */
define('DB_USER', 'your PostgreSQL database username will go here');
/** MySQL database password */
define('DB_PASSWORD', 'your PostgreSQL database password will go here');
/** MySQL hostname */
define('DB_HOST', 'localhost');

Run the Install Script

Point a web browser to start the installation script. If you placed the WordPress files in the root directory, you should visit: If you placed the WordPress files in a subdirectory called blog, for example, you should visit:

Having said all of that, before actually starting this process, make sure to have a backup of your droplet!

Another thing, this is a workaround. In a perfect environment, I wouldn’t recommend using it and just create a new droplet.

Regards, KFSys