WordPress multisite support (aka. Network Sites)

A multisite network is a collection of sites that all share the same WordPress installation. They can also share plugins and themes. The individual sites in the network are virtual sites in the sense that they do not have their own directories on your server, although they do have separate directories for media uploads within the shared installation, and they do have separate tables in the database.

The following steps are required in order to enabled multisite support in TurnKey WordPress:

1. Decide whether you want to use sub-domains or sub-directories

Wordpress multisites can either be served from a sub-domain or a sub-directory, for example:

Important: If you decide sub-domains, then SITE would be http://example.com . If you decide sub-directories, then SITE would be http://www.example.com .

Note: Sub-domains require you to be able to update your domains DNS records (see TurnKey Domain management).

2. Update the wordpress configuration

Edit /var/www/wordpress/wp-config.php

Delete the following:

define('WP_SITEURL', 'http://'.\$_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://'.\$_SERVER['HTTP_HOST']);

And in its place, add (replace SITE with what you decided in step 1):

define('WP_SITEURL', 'SITE');
define('WP_HOME', 'SITE');
define('WP_ALLOW_MULTISITE', true);

Update the database

Execute the following at the shell as root (replace SITE with what you decided in step 1):
mysql --defaults-extra-file=/etc/mysql/debian.cnf <<EOF
USE wordpress;
UPDATE wp_options SET option_value='SITE' WHERE option_name='home';
UPDATE wp_options SET option_value='SITE' WHERE option_name='siteurl';

Setup multisite in the web interface

Browse to http://SITE, log in as admin, click Tools -> Network Setup and follow directions.
Once you've completed the Network Setup, run the following command via shell to ensure the permissions for the WordPress admin interface are correct:
chown -R www-data: /var/www
For more information, refer to the official documentation.


Keyturns's picture

I would like to do WordPress multisite development on my local instance, but it is not clear to me from the steps above as to what value I should set 'SITE' to be to do this.

My Wordpress Turnkey appliance runs on my PC and gets its IP via DHCP and it is currently

Can I just use the IP or is some sort of domain name required to enable Wordproess multisite? Can I simply enter the 'SITE' value as the current IP in /var/www/wordpress/wp-config.php like so?:

define('WP_SITEURL', '');
define('WP_HOME', '');
define('WP_ALLOW_MULTISITE', true);

And run the SQL as so?:

mysql --defaults-extra-file=/etc/mysql/debian.cnf <<EOF
USE wordpress;
UPDATE wp_options SET option_value='' WHERE option_name='home';
UPDATE wp_options SET option_value='' WHERE option_name='siteurl';


The IP for my Wordpress Turnkey appliance is obtained via DHCP, will a different IP be picked up OK or will I need to edit wp-config.php and re-run the SQL every time?




stefano's picture

I done this way and it worked....just remember tu use the 'http://' prefix in the option_value SQL update.

wazi's picture

Hi I have an instance of TK-WP running our company's website.  We are taking on another company and would lik eto move their Wordpess site into our infrustructure.


Can we have www.companyA.com and www.companyB.com on the same TK-WP box.  Ideally we'd connect two network cards and have two different IPs for each site.

Adrian's picture

Hi there,

I have noticed that the posts on here are quite old so I am not sure whether anybody can help. I have the latest (14.1) version of Wordpress and I am looking to use multisite. I have tried following the instructions and have decided on the subdirectory option. I can make the changes to the wp-config.php without a problem. It is the next step that is confusing me.

I have tried in both mysql and CLI and cannot execute the commands in the 'update the database' section.

Is this procedure still relevant for 14.1 or do I need to do something else?

Great job by the way!! Excellent work with the ISO's.

Thanks in advance,


MarceloF's picture

I want to do a Subdir Multisite setup, but am getting this when getting into Tools --> Network setup:   Welcome to the Network installation process! Fill in the information below and you’ll be on your way to creating a network of WordPress sites. We will create configuration files in the next step. Network Details
Sub-domain Installation Because your installation is not new, the sites in your WordPress network must use sub-domains. The main site in a sub-directory installation will need to use a modified permalink structure, potentially breaking existing links.
Macamba's picture


I just have a fresh install and requested a Let's Encrypt certificate for different subdomains, which works. One of the next steps is that I want to disable http and enable https only. My question is before I move to https only access in which order should I perform above procedure regarding multisite:

1) Disable http access first and execute above procedure with 'https://' SITE prefix as parameter.

2) Execute above procedure with 'http://' SITE prefix as parameter and then disable http access.