I have a nextjs project and don't know how to deploy on Zerops.io?
can someone help me deploy my nextjs project on Zerops.io?
83 Replies
have you tried the example app ? https://app.zerops.io/recipe/nextjs-nodejs
(or SSG, if you prefer static https://app.zerops.io/recipe/nextjs-static)
yeah I have deployed that but I don't know how to migrate my project
can we go to voice channel to share my screen maybe?
are you available?
hey, what does your project use?
nextjs
I think ssr
does it use any redis or postgres ?
or its a basic project ?
supabase
I just started it
okay so you have your envs right ?
I set up supabase authentication and homepage profile page
setup a service and setup envs there
yeah
and
use this yml and push to the service
can I use lts nodejs?
assuming you know how to push via zcli
is it 22 I think?
yea
yea nodejs@22
ok how to push?
do you have zcli on your system ?
no
Using zCLI | Zerops
Learn how to install and use zCLI, the powerful command-line tool for interacting with Zerops. Explore zCLI commands, streamline service management, and simplify your workflow from your terminal.
its zerops cli? right?
ok
set it up on your system
and ping me when you're done
ready

make sure to login 😄
I mean I run npm i -g @zerops/cli
ok
yeah it will install zcli globally on your system

when did you get this error ?
are you sure about the hostname ?
when using your recipe
Oh are you trying to import the yml i sent you ?
yeah
oh it doesn't work like that
you'll have to create a zerops.yml in the root of your project
and then do zcli push (make sure you're logged in) from your terminal
how to login from terminal?
@ZenitoGR | Chris | new dev here^
grab your personal access token from zerops dashboard
ok cool
and then do
zcli login <paste your token>
!!!!!!

ok now what?
I create yml
zerops:
- setup: app
build:
base: nodejs@22
buildCommands:
- pnpm i
- pnpm run build
deployFiles: ./
run:
base: nodejs@22
ports:
- port: 3000
httpSupport: true
start: pnpm start
yes
is there usage costs?
on free tier?
actually we don't really give out free tier but we do give out free credits.
oh I see :/
so most likely it'll cost $1.45 per month if its a basic nextjs ssr project
oh nice!
either way - do you have a zerops project ?
no
how to push?
or first create?
how to create?
create one and setup a nodejs v22 servicefirst
wait
ok
can we hop on voice to share my screen?
please?
im a bit busy with something right now - not the right time
sorry
oh ok
@ZenitoGR | Chris | new dev here^
I went to import before ok
when you're creating your service - you can just add your secrets
and after you're done with all this
❤️
just push your changes with
zcli push
?

here?
I am not very good with github
its a preference
when I commit I want to have production and dev
you don't really need to setup that
i'm not sure what you mean by this
like I have the main branch for production and dev branch for dev/preview
yea you can do that
❤️
add two services,
prod
and dev
, in prod select to trigger on "Push to branch" and select main
from branches
in dev do the same but select branch preview
great! thank you! will come back if I have any other questions!
btw you zerops.yml needs to reflect that
NEXT_PUBLIC_SUPABASE_URL do I put this in env?
you can do
or supabase has some kind of connection?
see 👆
yes
let me check
this config assumes you've added two nodejs22 services names
prod
and dev
btwyou can define your variables like this, the same can be done in the
build
section for your build
if you need some sensitive information in your variables, you can go to the service detail in GUI, find
Environments variables
and add it as a "Secret variable"ok!

open pipeline detail and show build log

but my app runs locally
with npm run dev?
is it eslint?
like on vercel?
what happens when you do
npm run build
locally?ok same
let me fix the eslint build bugs
and If I have any issue will come back
but one question
I still need two services on zerops for production and dev?
even with this yml file you shared?
yes, you don't want your production to possibly be affected by whatever you are doing in development / preview, that's just the best practice
you can easily start / stop the
dev
service when you don't need it and it will cost nothing