Deploy an Express app with PostgreSQL, free
Put an Express app online on its own HTTPS address, with a real PostgreSQL database beside it and an editor in the browser, on a free plan. Start from our starter with one click, or bring your own Express app: Uppcoder i
Put an Express app online on its own HTTPS address, with a real PostgreSQL database beside it and an editor in the browser, on a free plan. Start from our starter with one click, or bring your own Express app: Uppcoder installs its packages, sets PORT and DATABASE_URL, and starts it.
What you get on the free plan
One app with one database: 2 GB of memory and 2 GB of disk, an editor in the browser and a terminal in the same container as the app, its own HTTPS address from the first minute, SSH from your own editor if you prefer it, and a nightly backup to a separate server. No card, no time limit.
One click: the starter's Deploy button
Open github.com/Uppcoder/express-postgresql-starter and press Deploy to Uppcoder. The deploy page opens with the starter already set up: Express as the main app, connected to its own PostgreSQL 17 database. Give the app a name, press Deploy, check the summary and press Confirm and deploy. Uppcoder clones the repository, runs npm install and starts the app.
Try it
Open the app's address: it says whether the database is connected. /status runs a query and shows the PostgreSQL version, and /notes is a small notes API with its table created on startup. Add a note from the web terminal, which runs next to the app:
curl -X POST -H "Content-Type: application/json" -d '{"text": "first note"}' http://127.0.0.1:8000/notes
The app starts private, behind your Uppcoder login, until you make it public.
The database is already wired in
The app gets the whole connection as DATABASE_URL, and the parts as POSTGRES_HOST, POSTGRES_PORT, POSTGRES_DB, POSTGRES_USER and POSTGRES_PASSWORD, so no password sits in your code. The starter reads DATABASE_URL with the pg package. It runs on Node 22 as node --watch index.js, so every save in the editor restarts the app with the change.
Bring your own Express app
Build a stack with Express and PostgreSQL, then paste your repository's https address on the Express card (with an access token if it is private). Uppcoder starts the first of these it finds: index.js, the file named in package.json main, server.js, app.js, src/index.js, otherwise npm start. Listen on process.env.PORT, as almost every Express tutorial already does.
One path is taken: /health is answered by the platform itself (its health check), so give your own status route another name. That is why the starter uses /status.
The full guide, with every screenshot: https://portal.uppcoder.com/guides/deploy-express-postgresql?utm_source=devto&utm_medium=blog&utm_campaign=posts&utm_content=post-227
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.
