PortSync’s architecture is completely stateless. Start with a simple 1-click local Docker setup. When you hit a million views, seamlessly decouple your database and scale the web nodes infinitely behind a load balancer. No command line required.
By default, PortSync installs the Next.js web app and the database (PostgreSQL/MongoDB) together inside a single machine via Docker Compose.
When a single machine is no longer enough, you cannot simply duplicate the machine, otherwise you will have fragmented, isolated databases. You must decouple the database using the Built-in Admin Migration tool.
Because PortSync uses stateless JWT authentication and saves data externally, your web containers are now officially stateless. You can run 10, 50, or 1000 containers behind a load balancer and they will dynamically share the load.
You don't need to manually configure the setup script again. Just boot the script and select Scaling & Advanced Env Management! From there, you can remotely download your existing .env directly to the new machine in seconds. The script automatically handles version control with timestamped backups of your `.env` so you can always safely restore history. The script even provides the exact 1-liner copy/paste Docker command to boot the new Node, or you can simply run the exact same docker-compose.yml file you already know. The script can do it all for you!
If Node 2 crashes, the load balancer instantly redirects traffic to Node 1 & 3. If traffic spikes, auto-scaling groups deploy Node 4 & 5. Zero user data is lost.