Deploy Nuxt
Stackpad auto-detects Nuxt applications and configures the build automatically.
Quick deploy
- Push your Nuxt project to GitHub
- Create a new project on Stackpad and select your repo
- Stackpad detects
nuxtin your dependencies - Your app is live at
your-project.your-org.stackpad.eu
Configuration
Stackpad uses your build and start scripts from package.json. The defaults for Nuxt:
{ "scripts": { "build": "nuxt build", "start": "node .output/server/index.mjs" }}The default port is 3000.
Environment variables
Nuxt has runtime config for environment variables:
export default defineNuxtConfig({ runtimeConfig: { // Server-side only apiSecret: process.env.API_SECRET, // Available client-side public: { apiBase: process.env.NUXT_PUBLIC_API_BASE, }, },});Access them in your app:
const config = useRuntimeConfig();console.log(config.public.apiBase);Nuxt’s NUXT_PUBLIC_* variables can be changed at runtime (unlike Next.js), but setting them in the Stackpad dashboard and redeploying is the most reliable approach.
Database
Add PostgreSQL to your project and redeploy to get DATABASE_URL. Use it in server routes:
import { Pool } from 'pg';
const pool = new Pool({ connectionString: process.env.DATABASE_URL,});
export default defineEventHandler(async () => { const result = await pool.query('SELECT * FROM users'); return result.rows;});What’s next?
- Environment variables — manage configuration
- Custom domains — add your own domain
- PostgreSQL — database setup