Self-hosting
Host and maintain your own server for Robo.js projects.
Robo.js can be self-hosted on any platform that supports Node.js. This gives you full control over your infrastructure and deployment process. You will need Node.js v20 or newer installed on your server.
Running
Install dependencies
Make sure all dependencies are installed on your server:
npm installBuild for production
Compile your source code into an optimized production format. This is especially important for TypeScript projects:
robo buildSet environment variables
Configure all required environment variables on your server. See the Environment Variables page for details. Set NODE_ENV to "production" for production mode.
Start in production mode
Start your Robo server:
robo startOperational Considerations
When self-hosting, you are responsible for server uptime, security, and updates. The following are handled automatically by RoboPlay but require manual setup when self-hosting.
CDN
Use a CDN like Cloudflare to cache assets, reduce server load, and improve response times.
Docker
Containerizing with Docker ensures consistency across environments and simplifies scaling and updates. See the Docker Template for a quick start.
Logs
The Logger writes to stdout by default, but you can configure it with custom drains to write to files or logging services. The @robojs/better-stack plugin integrates with Better Stack for log collection and analysis.
Recovery
Unlike robo dev, robo start does not automatically restart on crashes. Use a process manager like PM2 to keep your Robo running in the background and restart it after failures.
TLS
Set up a TLS certificate if you plan to serve your Robo over HTTPS, especially when using a custom domain.
