Node.js Example - Deploy an Environment
Theory is useful, but nothing beats seeing a real deployment from start to finish. In this lesson, we walk through deploying a complete Node.js application — frontend, backend, and database — in Bunnyshell. Watch the video above to follow along with the exact steps.
Setting Up the Environment YAML
Every Bunnyshell deployment starts with the environment configuration file: bunnyshell.yaml. This file lives in your Git repository and defines the complete topology of your application — what services to run, how to build them, and how they connect to each other.
For a typical Node.js application, you will define three components. The frontend is usually a React, Vue, or similar single-page application served by a lightweight Node.js process or a static file server. The backend is your Express, Fastify, or NestJS API server that handles business logic. The database is a PostgreSQL, MySQL, or MongoDB instance that stores your application data.
Each component entry in the YAML specifies a kind (either Application for services built from source or Database/Service for pre-built images), a gitRepo pointing to your repository and branch, a dockerCompose or dockerfile path for building, exposed ports, and environment variables. The backend component typically needs a database connection string, which Bunnyshell can inject automatically based on the database component's internal hostname and port.
One of the important details is defining dependencies between components. Your backend depends on the database being available before it starts, and your frontend might depend on the backend URL being resolvable. Bunnyshell handles service discovery within the environment — each component is accessible to other components by its name, similar to Docker Compose networking.
Building and Deploying
Once your bunnyshell.yaml is committed to your repository, creating the environment in Bunnyshell takes just a few clicks. Navigate to your project, create a new environment, and point it at your repository and branch. Bunnyshell reads the configuration file and begins the build and deployment process.
The build phase runs your Dockerfiles for each application component. You can watch the build logs in real time from the dashboard. Common Node.js build steps include installing dependencies with npm install or yarn install, running the build script to compile TypeScript or bundle frontend assets, and setting up the production runtime. Bunnyshell caches Docker layers between builds, so subsequent deployments are faster.
The deploy phase creates the Kubernetes resources for each component — pods, services, ingresses, and persistent volumes for databases. Bunnyshell orchestrates the startup order based on the dependencies you defined, ensuring the database is ready before the backend attempts to connect. The entire process — from clicking "Deploy" to having a running environment — typically takes between two and five minutes for a Node.js stack, depending on build complexity and dependency count.
Verifying the Running Environment
After deployment completes, each component shows a green "Running" status in the dashboard. Components that expose HTTP ports get unique URLs assigned automatically. Click the URL next to your frontend component, and you should see your application running live in the browser.
To verify that all components are communicating correctly, test the critical paths of your application. Submit a form that writes to the database, hit an API endpoint that reads data, or trigger any workflow that exercises the connection between frontend, backend, and database. If something is not working, check the component logs — the most common issues at this stage are incorrect environment variables (especially database connection strings) or ports that do not match between the application configuration and the YAML.
The environment dashboard also shows resource utilization — CPU and memory usage for each component. This is useful for right-sizing your resource requests and limits. If a Node.js backend is consistently using 50MB of memory but you allocated 512MB, you can adjust the limits in your YAML to use resources more efficiently. Conversely, if a component is hitting its memory limit and being killed, you know to increase the allocation.
With your environment running, you now have a live, shareable deployment that reflects your exact code. Share the frontend URL with your team for review, run automated tests against the backend API, or use it as a stable development baseline.
Ship faster starting today.
14-day full-feature trial. No credit card required. Pay-as-you-go from $0.007/min per environment.
Frequently Asked Questions
What do I need to deploy a Node.js app in Bunnyshell?
You need a Git repository with your Node.js application code and a Dockerfile for each component (frontend, backend). Bunnyshell handles the build, container orchestration, networking, and deployment. You define the environment structure in a bunnyshell.yaml file that specifies components, their sources, ports, environment variables, and dependencies.
Can I deploy a Node.js app with a database in Bunnyshell?
Yes. Bunnyshell environments can include database components like PostgreSQL, MySQL, or MongoDB alongside your Node.js services. The database runs as a container within the environment, with persistent storage and environment variables for connection strings automatically available to your application components.
How do I access my deployed Node.js application?
After deployment, Bunnyshell provides a unique URL for each component that exposes an HTTP port. You can find these URLs in the environment dashboard under each component details. The URLs are publicly accessible and use HTTPS, so you can share them with teammates, QA, or stakeholders for review.