By the end of this guide, you will have a Next.js application reading four sample records from a PostgreSQL database on Helicarrier. You will deploy the code from GitHub, connect the database without copying its password, and run a schema migration before releasing the application.
The example is a small launch board. Its records are fictional, and its public page only reads data. It has no login or public write endpoint, which makes it a useful disposable deployment exercise.
Before you start
- A Helicarrier workspace with permission to create a project, a web service, and a database.
- A GitHub account and a copy of the launch-board example repository. Fork it into your account, then make sure Helicarrier’s GitHub connection can access that repository.
- A disposable project. The screenshots use Helicarrier Tutorials Demo; use your own project and keep existing production data separate.
We used Heli S1 for the app and Heli DB-S1 for PostgreSQL: 512 MB of memory each, with 2 GB of database storage. Standard full-month reference rates are $3 for the app and $3.50 for the database, before optional add-ons. The screenshots show the account’s NGN estimate. Review your current dashboard prices before creating anything; these figures are not a quote for your account or a production sizing recommendation. Compare the PostgreSQL plans and storage costs, or see all platform pricing.
1. Create the database
Open your project and select an environment. This demo uses its default environment, named Production; it contains only tutorial resources. Select New service → Database → PostgreSQL.
Name it tutorial-postgres, select PostgreSQL 16, set the database name to helicarrier_guide, and use guide as the username. Leave the password blank so Helicarrier generates one. This application does not need any optional extensions.

Choose Heli DB-S1 with 2 GB of storage. We left the optional daily-backup add-on off for this short-lived exercise. For an application you intend to keep, review the backup and restore policy and choose an appropriate backup plan.
Select Provision. The new dashboard stages the change on the canvas; select Apply to create the database. Wait until its status is active. Keep external database access off: the application will use a private service reference.
2. Deploy the application from GitHub
In the same project and environment, choose New service → GitHub repository. Select your copy of the example and its main branch. Use these settings:
| Setting | Value |
|---|---|
| Name | tutorial-launch-board |
| Service type | Web service |
| Internal port | 3000 |
| Root directory | Leave blank for the standalone example repository |
| Build strategy | Auto, which detects the included Dockerfile |
| Install, build, and start commands | Leave blank; the Dockerfile defines them |
| Release command | Leave blank for this first deployment |
| Plan | Heli S1 |

Select Create & deploy, then Apply on the canvas. Follow the deployment until the web service is active. Its generated URL may initially show Setup needed; that is expected before the connection and migration are applied. At this stage /health returns HTTP 503.
The Dockerfile builds a standalone Next.js server, binds it to 0.0.0.0:3000, and runs it as a non-root user. The build does not need a database. Keep the default read-only filesystem enabled; this application stores its data in PostgreSQL.
3. Connect PostgreSQL with a reference
Open the application service, then Variables & secrets. Select Reference a variable from another service. Choose tutorial-postgres as the source, Connection URL as the value, and DATABASE_URL as the variable name. Select Add reference.

A reference resolves the provider’s current connection details when the app deploys. Do not add a second manual DATABASE_URL, paste a password into GitHub, or enable external access for this connection. Do not use NEXT_PUBLIC_DATABASE_URL: variables with that prefix can be included in browser code.
The example uses a server-side connection pool with a maximum of five connections. Each page request reads from PostgreSQL; the browser receives the displayed records, not the connection string. Learn more about service references.
4. Run the migration during release
Open the app’s Service settings. Under Build settings, choose Force Dockerfile, set the Dockerfile path to Dockerfile, and set the Release command to:
npm run db:migrate
Select Save & redeploy. In Deployments, follow the new release. The migration creates guide_launches, inserts four fictional records, and records the migration in guide_migrations. Successful logs include:
Running release command: npm run db:migrate
Database migrations applied. The launch board is ready.
Release command succeeded.The migration runs inside a transaction and takes an advisory lock so overlapping releases do not apply it twice. Subsequent releases skip recorded migrations. This is a small teaching example, not a complete migration framework. Add a new migration file for later schema changes rather than editing an already-applied file.
5. Verify the result, then monitor it
Open the generated URL shown in the app’s service overview. You should see PostgreSQL connected and four rows, including “Give the idea a home” and “Connect the data layer.” Refresh the page to confirm it still reads the database.

Check the readiness endpoint, replacing the placeholder with the exact URL from your dashboard:
curl --fail https://YOUR-SERVICE.on.helicarrier.xyz/health
# Expected: {"ok":true}This endpoint returns HTTP 200 only when it can query the application table. An HTTP 200 response from the homepage alone is not enough: its setup screen deliberately renders even when the database is not ready.
Under Service settings → Health checks & auto-recovery, enable Automatic health checks, set the health path to /health, keep the interval at 30 seconds and the failure threshold at 3, then save that section. These checks can restart the app after consecutive failures; they cannot repair a broken database or migration.
Finally, deploy the same code again. The release command should succeed, /health should return OK, and the board should still contain four rows. This checks that the release is repeatable, not just that the first migration worked.

If a step fails
- Repository missing: check the selected GitHub account and whether the existing Helicarrier GitHub connection can access your example repository.
- Build succeeds but the service cannot start: confirm the internal port is
3000and clear any start-command override. The included image supplies its own start command. - Setup needed or HTTP 503: confirm PostgreSQL is active, the app has the reference named exactly
DATABASE_URL, and you deployed after adding it. Then look for a successful release command. - Migration fails: inspect the release logs and verify the reference and database status. Fix the cause and redeploy. Do not delete an existing database as a troubleshooting shortcut.
- Memory pressure: review Metrics and runtime logs before changing plans. The small plan used here is for a light demonstration, not an estimate for your production workload.
When asking for support, share the failing step and a sanitized error. Keep passwords, connection strings, and API keys out of screenshots and messages.
Clean up, or keep building
If this was a disposable exercise, remove the example app and its database through each service’s Service settings → Remove service action. Verify the names before confirming, and check that only the tutorial resources were removed. Export any data you want to keep first.
If you are keeping the application, review backups, capacity, and access before using real data. Add a custom domain when you are ready. To investigate deployments through your coding agent, continue with the MCP guide; for exact build options, use the build and runtime reference.