self-hosting next.js in 2026: docker, sqlite, and freedom - By Sourav Mishra (@souravvmishra)
a simple guide on how to host next.js yourself and skip the vercel lock-in. let's run it with docker and sqlite.
hey, i am sourav mishra. vercel is great and all, but sometimes you just don't want to be locked in. self-hosting next.js in 2026 is actually super easy now.
i love self-hosting when i want full control of my data or just want to keep the bills low.
what we're using
- the engine: node.js inside docker.
- the database: sqlite with turso or litefs.
- the network: cloudflare or any basic vps.
setting up docker for next.js
next.js has a standalone mode that is literally made for docker. open your next.config.js and add this:
module.exports = {
output: 'standalone',
}
this makes your docker image way smaller, up to 80% smaller! it only packs what you actually need.
why sqlite?
for apps that are mostly reading data (like blogs or a small saas), sqlite is crazy fast. it lives right next to your code on the disk. no network lag at all.
does it help with seo?
yep! self-hosting gives you total control over how fast your server responds. a faster server means better seo. i talk more about this in my page 5 recovery plan.
written by sourav mishra. stay independent!