Shipping a Node.js application in Brazil should not require manual servers, Nginx, TLS certificates, dollar-denominated billing, and a week of infrastructure tuning. If the application runs in a container, Guara Cloud can take it to production with domains, HTTPS, and observability in a few steps.
This guide uses a simple Node.js API as the reference, but the flow applies to Express, Fastify, NestJS, and any runtime that exposes an HTTP port.
Quick answer
To deploy a Node.js application in Brazil, package the app as a Docker image, make it listen on the PORT environment variable, configure environment variables outside the codebase, and publish the service on Guara Cloud. The platform runs on Linode LKE in São Paulo and provides managed HTTPS, logs, and BRL billing.
Key takeaways
- Use a reproducible Dockerfile with a committed lockfile.
- Read
PORTfrom the environment and listen on0.0.0.0. - Configure secrets from the dashboard, never in the repository.
- Validate the public URL, logs, CPU, and memory after the first deploy.
When this guide applies
Use this flow for Express APIs, Fastify services, NestJS backends, HTTP workers, and any Node.js service that can run in a container. If the app needs a database, create the database service from the catalog and inject the connection URL as an environment variable.
When not to use this flow
This guide does not cover purely static apps, serverless deploys without containers, or workloads that need direct Kubernetes access. For those cases, use the platform documentation for the specific service type.
Before you start
- A Node.js application with a start script
- A working Dockerfile
- A Guara Cloud account
- Environment variables kept outside the codebase
1. Prepare the app to run in a container
The most important detail is making sure the app listens on the port provided by the environment.
const port = Number(process.env.PORT ?? 3000); 2. Create a production Dockerfile
Use a small image, install dependencies from the lockfile, and run the application without relying on local files.
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
ENV NODE_ENV=production
CMD ["npm", "start"] 3. Configure environment variables
Never put secrets in the repository. Configure database connections, tokens, and keys from the Guara Cloud dashboard.
Environment variables
| Name | Value |
|---|---|
NODE_ENV | production |
PORT | 3000 |
DATABASE_URL | postgres://... |
4. Deploy on Guara Cloud
Once the container is ready, connect the repository or provide the Docker image. The platform handles the service, internal domain, HTTPS, and logs.
Step by step
- Create a new service in Guara Cloud
- Choose GitHub deploy or Docker image deploy
- Confirm the HTTP port for the application
- Add the environment variables
- Start the deploy and watch the logs
5. Validate logs, domain, and service health
After the first deploy, confirm the application responds from the public URL, review logs, and watch CPU and memory usage. This avoids discovering problems only after users hit the service.
Troubleshooting
- Problem The application starts but does not respond
- Solution Confirm it listens on 0.0.0.0 and uses the configured port.
- Problem The build works locally but fails during deploy
- Solution Make sure the lockfile is committed and the Dockerfile does not depend on ignored files.
- Problem The service needs a database
- Solution Create PostgreSQL from the catalog and configure DATABASE_URL on the service.
What is the simplest way to publish Node.js in Brazil?
The simplest path is to create a Docker image for the app, configure PORT and environment variables, and publish the service on a Brazil-hosted platform like Guara Cloud.
Do I need to configure Nginx and TLS certificates manually?
No. On Guara Cloud, the service gets managed HTTPS and a public domain without manually operating Nginx or certificates.
Is billing in BRL?
Yes. Guara Cloud bills in BRL through Stripe, avoiding dollar conversion for Brazilian teams.
Ship your next Node.js service on Guara Cloud
Container deploys, HTTPS, logs, and BRL billing without managing Kubernetes.