Set up a server
A MacroGraph server runs your project around the clock on your own hardware, such as a home server, NAS, or VPS. You edit it from the browser, and changes apply immediately. All you need is Docker; the image runs on both amd64 and arm64.
Run this on the machine that will host MacroGraph. Docker downloads the image and starts it in the background, restarting it whenever the machine reboots.
Your project is kept in the
macrograph-datavolume, so it survives restarts and updates.Using Docker Compose instead?
Save this as
compose.yamland rundocker compose up -d.services: macrograph: image: ghcr.io/brendonovich/macrograph-server:beta container_name: macrograph restart: unless-stopped ports: - "3001:3001" volumes: - macrograph-data:/data volumes: macrograph-data:The first time it starts, the server prints a one-time setup link to its logs. Open it in your browser.
If the server is on another machine, use its address instead of
localhost, then paste theMACROGRAPH_SETUP_KEYwhen asked. SettingMACROGRAPH_PUBLIC_ORIGINmakes the printed link use that address.Anyone with the link can claim the server, so keep your logs private until you're done. It changes whenever an unclaimed server restarts.
The account you approve with becomes the server's owner, and the server can use the accounts you've connected to MacroGraph, like Twitch and Discord. You can remove it any time under Account → Apps.
Head back to your server's tab. You're signed in as its owner, and the editor is ready.
docker run -d --name macrograph --restart unless-stopped \
-p 3001:3001 -v macrograph-data:/data \
ghcr.io/brendonovich/macrograph-server:betaUnable to find image 'ghcr.io/brendonovich/macrograph-server:beta' locallybeta: Pulling from brendonovich/macrograph-serverStatus: Downloaded newer image for ghcr.io/brendonovich/macrograph-server:beta7c2d9e41b8a3f05e6d1c9a8b7e6f5d4c3b2a1908f7e6d5c4b3a29180f7e6d5c41Start the container
Terminaldocker run -d --name macrograph --restart unless-stopped \ -p 3001:3001 -v macrograph-data:/data \ ghcr.io/brendonovich/macrograph-server:betaUnable to find image 'ghcr.io/brendonovich/macrograph-server:beta' locallybeta: Pulling from brendonovich/macrograph-serverStatus: Downloaded newer image for ghcr.io/brendonovich/macrograph-server:beta7c2d9e41b8a3f05e6d1c9a8b7e6f5d4c3b2a1908f7e6d5c4b3a29180f7e6d5c4Run this on the machine that will host MacroGraph. Docker downloads the image and starts it in the background, restarting it whenever the machine reboots.
Your project is kept in the
macrograph-datavolume, so it survives restarts and updates.Using Docker Compose instead?
Save this as
compose.yamland rundocker compose up -d.services: macrograph: image: ghcr.io/brendonovich/macrograph-server:beta container_name: macrograph restart: unless-stopped ports: - "3001:3001" volumes: - macrograph-data:/data volumes: macrograph-data:2Open your setup link
Terminaldocker logs macrographMACROGRAPH_LISTENING 3001MACROGRAPH_SETUP_KEY kD3vQm8Zr1pXw7NcY2tLh5sF0gJb9uAeE4oVi6nRk-c[18:42:07.512] INFO (#3): Open http://localhost:3001/#setup-key=kD3vQm8Zr1pXw7NcY2tLh5sF0gJb9uAeE4oVi6nRk-c to set up this server.[18:42:07.631] INFO (#3): Listening on http://0.0.0.0:3001The first time it starts, the server prints a one-time setup link to its logs. Open it in your browser.
If the server is on another machine, use its address instead of
localhost, then paste theMACROGRAPH_SETUP_KEYwhen asked. SettingMACROGRAPH_PUBLIC_ORIGINmakes the printed link use that address.Anyone with the link can claim the server, so keep your logs private until you're done. It changes whenever an unclaimed server restarts.
3Claim your server
The account you approve with becomes the server's owner, and the server can use the accounts you've connected to MacroGraph, like Twitch and Discord. You can remove it any time under Account → Apps.
4Start building
Head back to your server's tab. You're signed in as its owner, and the editor is ready.
Updating
Pull the latest image and recreate the container with the same volume. Your project and sign-in are kept.
docker pull ghcr.io/brendonovich/macrograph-server:beta
docker rm -f macrograph
docker run -d --name macrograph --restart unless-stopped \
-p 3001:3001 -v macrograph-data:/data \
ghcr.io/brendonovich/macrograph-server:betaWith Compose, run docker compose pull then docker compose up -d.
Configuration
Pass these to docker run with -e NAME=value, or under environment in Compose.
MACROGRAPH_PUBLIC_ORIGIN- The address people use to reach the server, such as
https://macrograph.example.com. Setup links use it, so set it when the server isn't onlocalhost. MACROGRAPH_SERVER_NAME- The name shown when approving the server. Defaults to the container's hostname.
MACROGRAPH_ADMIN_IDS- Comma-separated MacroGraph user IDs that can edit the project, in addition to the owner.
PORT- The port the server listens on inside the container. Defaults to
3001.
Remote access
To reach the server from other devices, put it behind a reverse proxy with HTTPS and set MACROGRAPH_PUBLIC_ORIGIN to its public address. The proxy must forward WebSocket connections.
Backups
Everything the server keeps, including the project, module settings, and who owns the server, lives in /data. Back up the whole volume, and keep it private: it contains sign-in data and module credentials. If you bind-mount a directory instead of using a volume, make it writable by user 1000:1000.
MacroGraph