SlickStack plays nicely with remote database servers, and this approach is actually encouraged for certain high-traffic websites or situations where data integrity and compartmentalization is crucial.
Because the installer is idempotent, you can change to use a remote database at any point without issue.
Find the following section in the /var/www/ss-config
file:
DB_REMOTE="false" DB_HOST="127.0.0.1" DB_PORT="3306" DB_NAME="production" DB_PREFIX="wp_" DB_USER="@DB_USER" DB_PASSWORD="@DB_PASSWORD_USER" DB_PASSWORD_ROOT="@DB_PASSWORD_ROOT" DB_CHARSET="utf8mb4" DB_COLLATE=""
There are multiple options that you need to configure to connect to your remote database. Firstly, ensure that DB_REMOTE="true"
is set correctly. Next, change the values for DB_HOST
and DB_PORT
to match whatever your database server is using, which varies greatly depending on the vendor. Both of these values are critical, because without the correct port number SlickStack will not be able to connect to your remote database host.
For example:
DB_HOST="example-database-12345789.db.ondigitalocean.com" DB_PORT="25060"
Next you can set DB_NAME
which again, varies by provider. Some managed database vendors hardcode the database name and you must use that name, while others allow you to customize it.
Generally speaking, it's good to keep DB_PREFIX
set to wp_
just to make WordPress management more predictable, however if you're an expert and want stronger security you could also customize that value as well.
DB_USER
and DB_PASSWORD
should also be provided by your database vendor. Keep in mind that DB_PASSWORD_ROOT
is irrelevant for remote databases, and only applies to localhost MySQL configurations.
After you have all the options updated, save and exit from ss-config
. At this point, you will likely need to whitelist the IPv4 address of your origin (SlickStack) server in your remote database security settings, as most of the time dedicated database servers default to blocking all remote connections.
As far as Ubuntu packages go:
When DB_REMOTE
is set to false
then SlickStack installs the mysql-server
package, and when it's set to true
it will install the mysql-client
package instead. If you already installed SlickStack using default settings, but wish to change to using a remote database server and don't want extra packages installed, you could manually remove the mysql-server
package before running the SlickStack installation again to get mysql-client
installed only.
Disclosure: I'm the lead maintainer of SlickStack