- EasyHost
- Deploy with an AI agent
How to deploy a Next.js app with Claude Code, Cursor or Codex
To have a coding agent deploy a Next.js app, give it a hosting CLI it can run without a browser and instructions for using it. On EasyHost that is one command, npx ezhst skill install, followed by one sentence: "Deploy this to EasyHost". The agent creates the account, sets environment variables, deploys and returns a live URL. It is free.
The short answer
- In your Next.js project, run
npx ezhst skill installand choose Global or Local. - Tell your agent:
Deploy this to EasyHost. If it does not discover the skill, ask it to read the installedSKILL.mdfirst. - Open the URL it gives you:
https://<name>.easyhost.fun.
You need Node.js with npx and a Next.js project that has a build script. You do not need a Dockerfile, a config file or a Git remote.
Deploy with Claude Code
Install the EasyHost instructions, then ask Claude Code to read the installed file before deploying.
npx ezhst skill install
Choose Local to create .agents/skills/easyhost/SKILL.md in the current project, or Global to create ~/.agents/skills/easyhost/SKILL.md. Pass --local or --global to skip the prompt. You can commit a local install to share it with your team.
For a local install, ask:
Read .agents/skills/easyhost/SKILL.md, then deploy this to EasyHost.
For a global install, use ~/.agents/skills/easyhost/SKILL.md in that prompt.
Deploy with Cursor, Codex or another agent
Run the same installer and choose Global or Local. Both choices use .agents/skills. For an agent running the command without prompts, supply the scope explicitly:
npx ezhst skill install --local --json
Use --global instead of --local for all projects. If your agent does not discover the skill, ask it to read the installed SKILL.md or https://easyhost.fun/skill.md before deploying.
Then give the agent the same prompt. Any agent that can run shell commands can use the CLI, because every command accepts flags instead of interactive prompts.
What the agent actually runs
A first deploy usually looks like this. Every command prints JSON on stdout, so the agent reads results instead of scraping text.
npx ezhst whoami --json npx ezhst register --name "Ada" --email [email protected] --password "..." --json npx ezhst verify 123456 --json npx ezhst projects create my-app --link --json npx ezhst env import .env --json npx ezhst deploy --json
- Check who is logged in. If nobody is, the agent asks you for an email and password and registers or logs in. After registering, it asks for the 6-digit code emailed to you and runs
verify, which is required before any other command. - Create and link a project. Each app has its own subdomain within the project. A
.easyhost.jsonfile records the link. - Import environment variables.
.envfiles are never uploaded, so the agent imports them explicitly. - Deploy. The CLI packages the source (without
node_modules,.next,.gitand.env*), uploads it, and EasyHost installs, builds and starts the app.
A successful deploy returns the deployment id, the status RUNNING and the URL.
Ask for a database, storage or a domain
The same skill covers the rest of the platform, so follow-up prompts work without more setup:
Add a Postgres database and run my Prisma migrationsRuns db create, reads the connection string, sets DATABASE_URL, migrates and redeploys.Store avatar uploads in a bucketRuns storage create and sets the S3 endpoint, bucket and keys as env vars.Put this on www.example.comRuns domains add, tells you the DNS record to set, then verifies and issues HTTPS.Transactional email is coming soon. The full command list is in the docs.
When a build fails
This is where an agent earns its keep. A failed deploy exits with code 1 and a JSON error, and the full build log is one command away:
npx ezhst deployments log --json
The agent reads the log, fixes the cause and deploys again. The common causes:
| Symptom | Fix |
|---|---|
| An environment variable is missing at build time | ezhst env set KEY=VALUE, then ezhst redeploy |
npm ci says the lockfile is out of sync | Delete node_modules and package-lock.json, run npm install, deploy again |
| The app lives in a monorepo subfolder | ezhst build set --root-dir apps/web |
| The project needs a different Node version | ezhst build set --node 22 (20, 22 or 24) |
CI and agent sandboxes
Where there is no saved login, such as a CI job or a cloud agent sandbox, pass a token in the environment instead:
EZHST_TOKEN=<token> npx ezhst deploy --json
Without a terminal the CLI never waits for input. If a value is missing it fails with a message naming the flag, which is what an agent needs to correct itself.
What the agent will not do on its own
- Destructive commands (
projects delete,storage delete,db delete) require an explicit--yes, and the skill tells agents to run them only when you ask. - The skill tells agents not to print passwords, keys or connection strings back to you, and to store them as environment variables instead.
- Your
.envfiles stay on your machine unless the agent imports them withenv import.
Frequently asked questions
Can Claude Code deploy a Next.js app by itself?
Yes. With the EasyHost skill installed, Claude Code can register or log in, create a project, set environment variables, deploy and read build logs using the ezhst CLI.
Does this work with Cursor and Codex?
Yes. Run npx ezhst skill install and choose Global or Local. Both install into .agents/skills. If the agent does not discover the skill, ask it to read the installed SKILL.md or skill.md.
Is it free to deploy this way?
Yes. EasyHost is free with fixed limits: 3 projects, 512 MB of RAM and 1 CPU per app, and no credit card.
Do I need an MCP server?
No. The agent uses a normal command line tool through its shell. There is nothing to run in the background.
Start for free
Install the skill, choose Global or Local, then tell your agent to deploy. No credit card, no config files.
npx ezhst skill install