Introduction › One-click deploy
Introduction
Content
Using content
Plugins
Recipes
One-click deploy
What you'll learn
How to get a site with its admin running on Vercel or Netlify in a few clicks, and what to do next.
Before this page: nothing. To add Easy CMS to your own app instead, see Getting started.
Either button copies the starter to a new repository of yours and deploys it: a Next.js blog with its admin (posts, categories, media, SEO, roles and an audit log), with sample posts.
What you get
| Vercel | Netlify | |
|---|---|---|
| Database | Neon Postgres, created by the button | Netlify Database (Postgres), created at the first deploy |
| Uploads | Vercel Blob, created by the button | Netlify Blobs, created on first use |
| You type | a setup code | a setup code |
The only thing to fill in is the setup code (EASY_CMS_SETUP_CODE): any phrase you choose.
On a fresh site, whoever opens /admin first could otherwise make themselves admin; with the code,
only you can.
After deploying
- Open
/adminon the new site. - Create the first admin: your name, email, a password, and the setup code.
- Edit or delete the sample posts, and write your own. Invite your team from Settings → Users.
If something doesn't work
Uploads fail, saying to connect a Blob store (Vercel). The deploy has no BLOB_READ_WRITE_TOKEN:
the Blob store wasn't added in the deploy form, or it was connected after the deploy started.
- In the project on Vercel, open Storage. If there is no Blob store, Create one: Blob, with Public access.
- On the store, Connect Project, choose this project and every environment.
- Settings → Environment Variables now lists
BLOB_READ_WRITE_TOKEN. Don't copy it anywhere else: anyone with it can change your files. - Deployments → ⋯ → Redeploy. New environment variables only reach new deployments.
The site fails with "No database". The platform gave no database URL. On Netlify, Netlify
Database is created at the first deploy because the starter installs @netlify/database; it needs
a credit-based plan, and Data & Storage → Database shows it. Older sites made from the starter
used Netlify DB (beta), which can no longer be created: update package.json and
easy-cms.config.ts from the starter,
or set DATABASE_URL to any Postgres, then redeploy.
/admin doesn't ask for a setup code. EASY_CMS_SETUP_CODE isn't set: add it in the project's
environment variables and redeploy before anyone creates the first admin.
For real use
- Set
EASY_CMS_SECRETin the project's environment variables (openssl rand -hex 32), then redeploy. Until then the starter makes one from the database URL, so a one-click deploy works at once; it is as secret as the database password, and changes if that does. - Change the content model in
easy-cms.config.tsin your new repository, create a migration (npx easy-cms migrate:create <name>), and push: each deploy runseasy-cms migratefirst. - Email for invitations and forgotten passwords: see Email.
- Your domain: set it in the platform, and
serverURLin the config.
How it works
The build runs easy-cms migrate, adds the sample posts while the database has none, then
next build. The config picks the database from DATABASE_URL (Vercel) or NETLIFY_DB_URL
(Netlify Database, which Netlify creates because the starter installs @netlify/database; it
needs a credit-based Netlify plan), and uploads from BLOB_READ_WRITE_TOKEN
(@easy-cms/storage-vercel-blob) or Netlify
(@easy-cms/storage-netlify-blobs); without them, it uses PGlite and the
uploads folder, for developing.
Other databases work too: Supabase or any Postgres through DATABASE_URL, or Turso with
@easy-cms/db-sqlite. See Databases.
Next steps
- Deployment: migrations, environment variables and other hosts.
- Tutorial: build a site with Easy CMS step by step.