This guide provides two options for deploying your backend built with NestJS: using Railway (full-stack deployment including MongoDB) or deploying only the backend to your preferred platform.
Railway allows seamless full-stack deployment, including your backend and database. Use the pre-configured template to deploy your backend, frontend, and MongoDB with minimal setup. If you have done the frontend setup you already go everything running dont repeat all steps.
DATABASE_URL
JWT_SECRET
PORT
URL
After deployment, Railway will provide a unique URL for your backend API.
If you prefer to deploy only the backend, you can use any Node.js hosting platform (e.g., AWS, Heroku, or DigitalOcean, Adaptable.io). MatureStack comes with a predefined Dockerfile which should work on any platform.
DATABASE_URL
JWT_SECRET
PORT
URL
Once deployed, your backend API will be available at the URL provided by your hosting platform.
For additional details, refer to the documentation of your chosen hosting platform or NestJS documentation.