This guide details how to set up a modified version of Mercury Core for production hosting.
For a guide on setting up Mercury Core for local development, see Development setup.
Requirements
Section titled “Requirements”You should already have the necessary dependencies and command line tools installed. If not, see Installation for an installation guide.
You will need:
- A correctly configured or modified version of Mercury Core
- Latest version of Bun installed (expected as
bun
) - Latest version of Go installed (expected as
go
, installation guide) - Latest version of SurrealDB installed (expected as
surreal
, installation guide) - Latest version of Caddy installed (expected as
caddy
) - A server to host it all on
- A terminal, either directly on the server or through remote access such as RDP, VNC, or SSH
If you wish to use containers instead of SurrealDB and Go, install the latest version of a container manager such as Docker (expected as docker
, installation guide) or an alternative container manager like Podman (installation guide).
Instructions
Section titled “Instructions”Copy the modified version of Mercury Core to your server and navigate to the root directory of the repository.
If not using containers, navigate to the Economy directory, and run
go build
to compile the Economy service.Navigate to the Site directory.
Copy the Site/.env.example file to Site/.env and modify it to set up the environment variables.
Run
bun prod
to install dependencies and begin building.Run
caddy start
to start the Caddy reverse proxy server.- You can also run
caddy reload
to reload the configuration file without restarting the server. - If you're using Caddy with multiple configuration files, import the Caddyfile in the repository's root directory into a Caddyfile somewhere else, and run
caddy start
andcaddy reload
from there.
- You can also run
If using containers, run
docker compose up -d
to start the Database and Economy services.Run
bun ./build
(not to be confused withbun build
) to start Mercury Core. This will start the Database and Economy services automatically if they are not already running.