Frontend Hosting
NaijaBase Sites lets you deploy your frontend — static HTML, React, Next.js, Vue, or Nuxt — directly to Lagos.
No Vercel. No Netlify. No USD bills.
Quick start
Option 1 — GitHub (recommended)
- Go to your project dashboard
- Click Sites in the sidebar
- Click New Site
- Enter your GitHub repo (format:
username/repo) - Select your framework
- Click Create
- Click Deploy
Your site is live at:
yoursitename.sites.naijabase.dev
Option 2 — Zip upload
- Build your site locally:
npm run build
- Zip the output folder:
# React/Vite
zip -r site.zip dist/
# Next.js static
zip -r site.zip out/
# Plain HTML
zip -r site.zip index.html
- Go to Sites → your site → Settings tab
- Upload the zip file
- Click Upload and Deploy
Framework presets
| Framework | Build command | Output directory |
|---|---|---|
| Static HTML | — | . |
| React / Vite | npm run build | dist |
| Next.js | npm run build | out (static) or auto-managed (SSR) |
| Vue | npm run build | dist |
| Nuxt | npm run build | .output/public |
| Node.js | optional npm run build | — (server process) |
Node.js Apps (Express, Fastify, custom)
Deploy any Node.js HTTP server to Lagos.
Requirements
Your app must listen on process.env.PORT:
// Express
const port = process.env.PORT || 3000
app.listen(port, '0.0.0.0', () => {
console.log(`Server running on port ${port}`)
})
// Fastify
await fastify.listen({
port: process.env.PORT || 3000,
host: '0.0.0.0'
})
Your package.json must have a start script:
{
"scripts": {
"start": "node server.js"
}
}
Deploy
- Select framework: Node.js
- Connect your GitHub repo
- Click Deploy
NaijaBase installs dependencies, runs npm run build if a build script exists, starts your app with PM2, assigns a port automatically, and configures Nginx with SSL.
Build logs:
[NaijaBase] Installing dependencies...
[NaijaBase] Starting Node.js app on port 41xx...
[NaijaBase] Node.js app deployed on port 41xx ✓
PORT is injected automatically — do not hardcode it.
Next.js
NaijaBase supports both Next.js modes — static export and SSR — detected automatically at deploy time.
Static export
Add output: 'export' to your config:
// next.config.js
module.exports = {
output: 'export',
}
The built out/ directory is served by nginx directly.
Server-Side Rendering (SSR)
No configuration needed. If your next.config.js does not have output: 'export', NaijaBase detects SSR automatically and:
- Adds
output: 'standalone'to your config during build - Runs
npm run buildto produce.next/standalone/ - Starts a Node.js server process managed by PM2
- Configures nginx to proxy requests to that process
// next.config.js — no output: 'export' means SSR
module.exports = {
// your existing config
}
SSR sites support dynamic routes, API routes, server components, and getServerSideProps.
Build logs show:
[NaijaBase] Installing dependencies...
[NaijaBase] Building Next.js app (standalone)...
[NaijaBase] Next.js SSR started on port 41xx
[NaijaBase] SSR site deployed ✓
Environment variables
Add environment variables in Sites → your site → Settings → Environment Variables.
They are injected as .env at build time:
// In your React app
const apiUrl = import.meta.env.VITE_API_URL
const anonKey = import.meta.env.VITE_ANON_KEY
# In Settings → Environment Variables:
VITE_API_URL = https://api.naijabase.dev/projects/YOUR_PROJECT_ID/rest/v1
VITE_ANON_KEY = nb_anon_xxxx
Private GitHub repositories
Add your GitHub personal access token as an environment variable:
Key: GITHUB_TOKEN
Value: github_pat_xxxxxxxxxxxx
Get a fine-grained token at: github.com → Settings → Developer Settings → Fine-grained tokens → Contents: Read-only
The token is never shown in build logs and is excluded from your built app.
Custom domains
Connect your own domain to NaijaBase Sites:
1. Add a CNAME record at your DNS provider:
| Type | Name | Value | TTL |
|---|---|---|---|
| CNAME | @ or www | yoursite.sites.naijabase.dev | 300 |
2. Connect in the dashboard:
- Go to Sites → your site → Domains tab
- Enter your domain
- Click Verify and Connect
- NaijaBase checks DNS and issues SSL automatically
Your domain is live with SSL in ~2 minutes.
Custom domains require the Growth plan (₦25,000/month) or above.
Deploying with a NaijaBase backend
Connect your NaijaBase backend to your hosted frontend using environment variables:
# In Sites → Settings → Environment Variables:
NEXT_PUBLIC_NAIJABASE_URL = https://api.naijabase.dev/projects/YOUR_PROJECT_ID
NEXT_PUBLIC_NAIJABASE_ANON_KEY = nb_anon_xxxx
// In your frontend app:
import { createClient } from '@naijabase/js'
const naijabase = createClient(
import.meta.env.NEXT_PUBLIC_NAIJABASE_URL,
import.meta.env.NEXT_PUBLIC_NAIJABASE_ANON_KEY
)
const { data } = await naijabase
.from('products')
.select('*')
Backend and frontend — both in Lagos. Both in naira. Both NDPA compliant.
Monorepo support
For projects where your app lives in a subdirectory (e.g. server/, apps/api/):
-
Set Root Directory in site settings:
server(the path to the folder containing your
package.json) -
NaijaBase runs all commands from that directory:
npm installnpm run buildnpm start(or custom start command)
Custom start command
Override the default npm start with any command:
node dist/main.js
npx ts-node src/index.ts
node -r tsconfig-paths/register dist/main.js
Set it in Sites → your site → Settings → Start Command.
NestJS monorepo example
Settings:
Root Directory: server
Build Command: npm run build
Start Command: node dist/main.js
Install Command: npm install
Your server/package.json build script:
{
"scripts": {
"build": "nest build && npx prisma generate",
"start": "node dist/main.js"
}
}
Your app must listen on process.env.PORT:
// main.ts
async function bootstrap() {
const app = await NestFactory.create(AppModule)
await app.listen(process.env.PORT || 3000, '0.0.0.0')
}
bootstrap()
Build logs for a monorepo deploy:
[NaijaBase] Cloning duro1983/my-monorepo (branch: main)...
[NaijaBase] Using root directory: server
[NaijaBase] Installing dependencies...
[NaijaBase] Building app...
[NaijaBase] Starting with custom command: node dist/main.js
[NaijaBase] Node.js app deployed on port 41xx ✓
Build logs
Every deployment shows real-time build logs:
Sites → your site → Deployments → click any deployment → View Logs
[NaijaBase] Build started at 2026-07-24T12:00:00.000Z
[NaijaBase] Cloning username/repo (branch: main)...
$ git clone --depth 1 --branch main ...
[NaijaBase] Installing dependencies...
$ npm install
[NaijaBase] Building...
$ npm run build
[NaijaBase] Configuring web server...
[NaijaBase] Deployed in 33s ✓
Rollback
Every deployment is saved. Roll back to any previous version instantly:
Sites → your site → Deployments → click Rollback on any past deployment
Plan limits
| Plan | Sites | Custom domains |
|---|---|---|
| Starter (₦0) | 1 | ❌ |
| Growth (₦25,000/mo) | 3 | ✅ |
| Scale (₦60,000/mo) | 10 | ✅ |
| Business (₦75,000/mo) | Unlimited | ✅ |
NaijaBase Sites vs Vercel
| Feature | Vercel | NaijaBase Sites |
|---|---|---|
| Hosting location | USA / Global CDN | Lagos, Nigeria |
| Billing | USD | Fixed naira |
| NDPA compliant | No | Yes |
| Backend included | No (separate) | Yes (same platform) |
| Custom domains | Yes | Yes (Growth+) |
| SSL | Yes | Yes (automatic) |
| Deploy from GitHub | Yes | Yes |
| Deploy from zip | No | Yes |
| Free tier | Yes | Yes |