Guide
Run one site on two servers
Add a second server to a site so every update goes to both, choose the order, try new versions on the main server first, and share visitors.
Last updated 2 min read7 stepsView as Markdown
What you will end up with
Servers this site runs on lists both servers, the first as Main server and the second as Runs the site. Each update says "Published on both servers".
Go to the first stepWhen one server is not enough, or you want the site to keep answering if one server stops, run it on two. Each update then goes to both servers.
What you need#
- A site that publishes from a code host or CI, and a second website server that is Online with what the site needs (for example the same PHP version).
- Uploaded files stored in one shared place (a database or file storage), and a database both servers can reach, ideally a Database server. Each server otherwise keeps its own uploads and its own local database.
Steps#
-
Prepare the shared parts. Point the site's Environment at a database both servers can reach (on a database server, allow both website servers under Who can reach this database server), and store uploads in shared storage.
-
Add the second server. Open the site's Settings › Servers this site runs on. Under Add a server, choose the Server and Add this server. The site is installed there the same way, then the live version is published on it.

Two servers: the main server and one that also runs the site. -
Choose how updates go. Open Update settings › Across servers. One server at a time (the main server first; if one fails, the others keep the version they have) is the safe choice. All servers at the same time is faster.


-
Optional: try new versions on the main server first. Turn on Try the new version on the main server first. After the main server is updated it is watched for a few minutes; the other servers follow only if it answers well, otherwise the main server goes back to the version before.
-
Check your own update steps. On Update steps, each step you added has Where this step runs. Keep database changes on Only the first server so they run once.
-
Publish an update. The update page shows one part per server, "server 1 of 2 · main" and "server 2 of 2", each with its steps.


-
Share visitors between the servers. Add a Load balancer server, then share the site out on it: for each website server, pick the site under Site on it. Turn on Secure the address with HTTPS and point the address at the load balancer. From then on, a server you add to the site is added to the load balancer automatically.
What you should see#
Servers this site runs on lists both servers, the first as Main server and the second as Runs the site. Each update says "Published on both servers".
If it goes wrong#
- A server cannot take the site: the list says why, for example a missing PHP version. Install it on that server first.
- The update stopped on the second server: with One server at a time, the servers after it keep the version they have; the update page says "Not updated" for them. Fix the cause and publish again.
- Visitors see different content on each server: uploads or the database are still per server. See step 1.
- HTTPS, backups and logs: these stay on the main server. With a load balancer, let the load balancer handle HTTPS for all servers.
Still stuck? Get help