117 Replies
Hi
@admin
@Louay feel free to address it please
they'll reply as soon as possible 😄
first i want to ask if i create a ubuntu container
thats mean like a vps hosted in zerops?
like i got a vps from hetzner or smth
@Jan Saidl or @Michal Saloň anyone pls?
It doesn’t use persistent storage so it wouldn’t save every time the container is reloaded
i can install coolify into that ubuntu machine or not?
okay let me share the problem louay is having
Unless you got a specific storage container that is, I think anyway
If I’m incorrect, my bad
he wants to ssh to the ubuntu service ~ i assume
somehow i created a new container then when i ssh it didnt ask for pass this time
Oh okay
then
works then
yup for now yes
thank you guyss :))
You’re welcome
Hi @Louay ,
when you create a project in Zerops, you get your own space as described here: https://docs.zerops.io/features/infrastructure
When you create an Ubuntu container in your project, this container is part of your project (its private network). The main difference compared to VPS is that the container is not directly accessible from the internet - this is mediated by a balancer that is dedicated to your project.
There is also a difference between container technology and VM. Zerops currently also supports VMs - currently the first representative is Docker service, where you get a full-fledged alpine VM.
In this service, you can probably install Coolify. Unfortunately, Docker cannot be run in a regular Ubuntu container.
when i tried it i get it get conflicted
saying that port 22 IS ALREADY IN USE
when i investigated it i knew that zerops uses port 22 for managing things for ssh or whatever
The SSH port is taken by our component that provides SSH access when you log in through VPN: https://docs.zerops.io/references/vpn
You can definitely start SSH on a different port and set up port routing and expose this port to the internet.
https://docs.zerops.io/features/access#open-a-public-port-for-a-non-https-communication
but here when i try to assign it
to open the port
the select list doesnt contain my service
Zerops YAML Configuration | Zerops
Learn how you can configure your zerops yaml and use the available parameters.
ahaa
i got it know
thnx alot man
Yes, it is necessary to deploy the application using a simple zerops.yaml file.
The most basic approach for usage is to deploy applications. Although the platform offers the possibilities you're trying - it's not currently completely straightforward. But it is possible to add these things in the future.
hey when i add the port part
it get failed everytime instantly
🤔 thats questionable
can you send a ss if possible
or a screen recording
zerops:
# supports monorepositories, just add
# one setup section after the other
- setup: ubuntu0
# ==== how to build your application ====
build:
# select what technology should the
# build container be based on, can
# be different from service technology
# see docs for full list
base: [email protected]
# optional add additional dependencies
# on top of base technology (combination
# will be cached for next build)
# prepareCommands:
# - apt-get something
# build your application
buildCommands:
- apt-get update
- apt-get install -y curl
- curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
- echo 'Coolify installation completed'
# select which files / folders to deploy
# after the build successfully finished
deployFiles:
- /etc/hostname
# optional: which files / folders
# to cache for the next use
# cache:
# ==== how to run your application ====
run:
base: [email protected]
# optional install dependencies that your
# runtime service requires (will be cached)
# prepareCommands:
# - apt-get something
# optional: triggered before each start/restart
# of your application, to eg. clean cache
# initCommands:
# - rm -rf ./cache
# how to start your application
start: |
# Start Coolify manually since systemctl may not work in a build container
/usr/local/bin/coolify start
# expose port 22 for SSH (coolify typically uses port 3000, adjust if needed)
ports:
- port: 22
protocol: TCP
httpSupport: true
even for port 8080 same problem
:this:
@Louay genuine question - why are you trying to self host a paas on a paas
🤔
nah nah for testing purposes
because i got problems with env
alright
that works
I don't think Coolify will work in a Container, as it's used for Docker orchestration and probably even itself partly runs in docker.
As Jan said above, our standard services use Linux Containers, not full fat Virtual Machines, and Docker can not run on containers.
We do support full VM's, but currently only for Alpine Linux. When you select
base: docker@latest
(for runtime or prepare, doesn't work for build
phase!), it would launch a full VM.so alpine is a full vm?
No, Docker is a full VM.
ahaa
https://app.zerops.io/dashboard/recipes @Louay for testing feel free to click and deploy anything you want
😼
yeah bro im fully satisfied with what you guys provide
i just got the thought
of hosting a vm machine
as i saw there are a ubuntu container
so i thought thats maybe a full vm like hetzner or smth
same problem here fail instantly
even with a docker container
The TL;DR why we provide containers and not VMs is that VMs can not scale without a restart.
So all our cool magic where your containers scale CPU/Disk/RAM up or down while running does not work at all with VM.
You need to set fixed resources and at max we can scale VMs horizontally (adding more VMs or less).
Also one big limitation of real VM is, you can NOT scale disk down. So if you accidentally set it to 50GB and then want less, that not possible without creation of a new VM.
Hence why everything but
Docker
is a Container.its the port part that causing failure
Oh yeah I didn't update the commands, you are running
apt
commands, but that VM is alpine, so apk add
instead of apt-get install
Invalid parameter provided.
{
"run.base": [
"alpine:latest"
],
"run.os": [
""
]
}
Are you trying my updated
zerops.yml
?yes one sec
zerops:
- setup: alpinevm
build:
deployFiles:
- /etc/hostname
run:
base: docker@latest
prepareCommands:
- apk update
- apk add --no-cache curl bash sudo
- curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash
- echo 'Coolify installation completed'
# Start Coolify manually since systemctl may not work in a build container
start: /usr/local/bin/coolify start
ports:
- port: 22
protocol: TCP
like this?oh btw if you are ever trying to send a code use ` three times
add
os: alpine
to run
section.
Btw, apk
does not need an update command and you should use sudo
for apk xxx
commands.something like this 👍
And one more question, how did you create the service? You could try this import
same
problem
this is the zerops.yml
THIS ONE DIDNT FAIL
Seems like the prepare did indeed go through. It will take a while to cache the image (we are working on speeding this up for VMs), let's see if it deploys succesfully.
btw while it might be possible, deploying Coolify to Zerops is essentially like putting a camping stove inside a fully equipped professional kitchen (running self-hosted PaaS on a managed PaaS that offers the same / better features - which you'll use none of by using Zerops just for resources and doing the rest of Coolify).. what functionalities that Coolify offers are you missing?
there are redis and i can expose the db make it public
just for testin
we offer Redis as a native service
it's Valkey or KeyDB, both open source and fully redis compatible services
We do have redis though, Valkey is a 1:1 replacement, Redis just changed their licence so people are leaving it.
oh
yup yup thats sounds good
but how can i make the db public>?
like i can access it localy
for now if you want to test the db - you can just do
zcli vpn up
and connect to your project's private network
and voilabut the hostname
exp its db
i replace it with the prv ip?
Currently you can't without some kind of proxy in front of it or using a
vpn
through our zcli
.
We do plan to add a toggle to expose the DB publically, but it might take a while.🤔
nah even with the private network sounds enough for me
thats more secure ig
so i change the postgres url
instead of the hostname i replace it with the ip?
if you are able to run the service that needs that access the db on Zerops
you can just connect using db's hostname
If you want to access DB on a service where you can install our
zcli
, then just using zcli login xxxx
and zcli vpn up
, then you can connect to db by db.zerops:port
(where db
is the name/hostname of the database service).2. Check OpenSSH server configuration.
2025-01-22T12:00:23.000Z service: service
sshd' does not exist
2025-01-22T12:00:23.000Z service: service
ssh' does not exist
2025-01-22T12:00:23.520Z - OpenSSH server not detected. Installing OpenSSH server.
2025-01-22T12:00:25.000Z error: Bind to port 22 on 0.0.0.0 failed: Address in use.
2025-01-22T12:00:25.000Z error: Bind to port 22 on :: failed: Address in use.
2025-01-22T12:00:25.000Z fatal: Cannot bind any address.
thats what i got when running the buildoh i didn't know that - nvm it's related to the internal services interacting with the db service
here's an example of
api
(Node.js service), accessing db
(postgres service)because the port 22 is used by zerops
btw using env variables
bcs in my app
also what's even more important, when you add up a database service on Coolify, like Postgres, it just spins up Docker container, this is by no means production-ready setup for database services - our native database services are set up with managed backups, failovers, healthchecks, repairs, scaling and optimizations
https://dev.to/zeropsio/the-rise-of-self-hosted-paas-is-5-vps-all-you-need-55no
DEV Community
The rise of self-hosted PaaS — is $5 VPS all you need?
There's a little trend going on over at the developer community on X, jokingly called "$5 VPS" —...
and everything is setuped like
THE db variable is not reachable
do you have a database service on Zerops called
db
?yes
is it not reachable in build you mean? or when it's running?
if you wanted
DATABASE_URL
in runtime, you'd setup your zerops.yml like this
wait
let me show you
you can also confirm the variables is available and present by going to remote shell and echoing it
You can always do
(note: make sure you have postgres service with db as a hostname)
you can use other envs which you can reference if you want to in your zerops.yml
(shared this because i felt you should know that)
If your app is checking for variables during
build
, then that will not work, as in build those envs are available with RUNTIME_
prefix.
Honestly, checking envs during build is not even a good practice... Most of the time you should be building the app ons ome runner else where and then deploy finished binary/files, why would a separated runner need your production envs?
So you can set custom dummy envs in build section, or as some servies do, use .env
file, just not dpeloy it (or deploy it, normals ervices override values from .env
file by actual env variables.but my problem is
i need to push the schema
so my app build success
otherwise it will fail
because in my page im requesting data from the db
thats what im doing
just pass the
DATABASE_URL
env to build
config as well
runtime (and secret)/build databases are not shared with build container by default, because imagine if you set NODE_ENV: production
for runtime and it applied to your build automatically as well - it wouldnt be able to buildbut you friend said that the env is not available during build
this is what I meant
so what i should do now
there's no need to put
DATABASE_URL
in your secret variables, as the value contains only the reference, no sensitive value, so just define it as part of your zerops.yml
in both build
and run
sectionsDATABASE_URL: ${db_connectionString}/${db_dbName} u mean?
yea if your DATABASE_URL requires database name as well, do that
DATABASE_URL: ${db_connectionString}/${db_dbName}
(just swap db
with postgresql0
or however is your database service actually called)yeahhh now worked
thnxx matee :>>>
btw
drizzle-kit push
would not be the best way to do this, here's a proper drizzle setup https://github.com/spartan-ng/spartan/blob/main/zerops.yml#L28-L29so i should replace it with that line ?
it uses
drizzle-kit migrate
instead of push
, which is more of a development command to quickly push changes.. it's also happening in runtime instead of build, which is the proper place for migrationsor add that line
can you add it here please??
sure, the problem is that drizzle is currently still all over the place (with both the code and their docs, it still feels like an alpha/beta), for example the
migrate
command requires you to pass a config file to it, instead of just defining the connection details using params / env variables)... you also need to locally generate the migrations, which you then commit to your repository.. but the final setup could looks something like thisand please one last question
im sorry if i asked alot
when i create a backup for the postgres db how can i push it ?
you might need to experiment with it a bit... the command to generate migrations would be
drizzle-kit generate
so your professional production-ready deployment process would be
1. connect to VPN to your staging copy of the project
2. locally run drizzle-kit generate
and commit the migration files
3. push to trigger deploy - Zerops will apply the migration on runtime initialization
that staging copy is actually optional, you can generate
even against your production db
it's just the cleanest would be to do it against staging env -> deploy to staging env -> confirm everything went ok on staging env -> deploy to prod env
all depends if you are working on some serious project or just some hobby stuffbut what if there are other envs are required for build to sucess
where i should put them
with the approach I sent you DATABASE_URL won't be needed in build anymore, but if you do have some envs you need in build, just list them at the same place
but thats mean their exposed
as someone could read my zerops.yml
yes, you can only put non-sensitive values to zerops.yml, if your build requires some tokens, you can add them to secret variables and them reference them in build using
RUNTIME_
prefix, let me show youwith this your secret
APP_KEY
will be available to build under TOKEN
and no secret will be exposed to zerops.yml, since it will only contain the referenceahaa
now i fully understand everythingg
thnx alot mate for your patience
just the question of the db backup
how can i push it for another db
our backups are currently more for emergency situations rather than for migrating / cloning data (as it backups the whole service, including users and the meta settings), the easiest thing for cloning you could do is to import adminer service to your project (using the
import services
button in project detail)
this will deploy a database management tool which you can use to export / import just particular tableslet me try it
otherwise what you can do is
zcli vpn up
, connect inside the private network, after which you'll be able to use your favorite local tool for database management and utilize the same hostname as if your PC was part of the private networkso by that i can export and import data
yes
with adminer, you can do this
If you are using postgres, you should be able to use
pg_restore -a -h newDbHost.zerops -d newDbHost -p 5432 -U postgres oldDbHost.dump
(our backup zip
files contain dbHostName.dump
files which contain backup for the entire schema).
But you would have to have pg_restore
(at least version 15 for PostgreSQL 16) installed locally and have zerops VPN up (so you can connect to db).
If your original DB is still running, then a simple export and import either via Adminer, DBeaver or JetBrains DataGrip etc. would probably be faster and easier to do.yes yes im using pgAdmin4
thank you guys for the help ❤️ hope the best for y all
You too!