D
Dokploy13mo ago
Raphael

Running Dokploy on a Hetzner ARM server.

Hey guys, when trying to run the installation script on my hetzner server (see screenshot) i always get the following error (see screenshot 2). From researching the topic i understand there are some problems with swarm and arm maybe? Any help to make dokploy run would be appreciated ❤️
No description
No description
118 Replies
Pharoh
Pharoh13mo ago
i'm doing this in RPI 4 and same thing happens i guess they didn't mentioned anywhere that it only works on x86
Raphael
RaphaelOP13mo ago
what i did now to fix it was clone the git repo myself onto my server, and building it myself for arm but thats not really a good solution, as the update buttons inside the application then wont work
Pharoh
Pharoh13mo ago
yeah just use x86
Raphael
RaphaelOP13mo ago
so for everyone wondering, i cloned the repository onto my server, copy the example env files (.env and .env.production), then run the following commands
docker buildx create --name mybuilder --use
docker buildx create --name mybuilder --use
then i build it for arm64 saving the image only localy
docker buildx build --platform linux/arm64 -t dokploy/dokploy:latest-arm64 --load .
docker buildx build --platform linux/arm64 -t dokploy/dokploy:latest-arm64 --load .
then i updated the prod.sh file inside the docker folder to run dokploy to the following
docker service create \
--name dokploy \
--replicas 1 \
--network dokploy-network \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
--publish published=3000,target=3000,mode=host \
--update-parallelism 1 \
--update-order stop-first \
dokploy/dokploy:latest-arm64
docker service create \
--name dokploy \
--replicas 1 \
--network dokploy-network \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
--publish published=3000,target=3000,mode=host \
--update-parallelism 1 \
--update-order stop-first \
dokploy/dokploy:latest-arm64
Done 🙂 dokploy now runs on your arm server. Watch out tho you cant use the following button, as it will crash the whole application:
No description
Siumauricio
Siumauricio13mo ago
nice, if you can submit a PR @Raphael would be awesome!
Raphael
RaphaelOP13mo ago
will do, probably after the weekend tho if thats fine, got finals 😵
Pharoh
Pharoh13mo ago
i'll do for you
Raphael
RaphaelOP13mo ago
sure if u know what to change
Pharoh
Pharoh13mo ago
no i just saw, can't do you do
Raphael
RaphaelOP13mo ago
would be easiest to update build step to create a arm image aswell and then push it to docker registry. Then in the install we just check the os and use the right image for the os
Siumauricio
Siumauricio13mo ago
GitHub
dokploy/docker/build.sh at canary · Dokploy/dokploy
Open Source Alternative to Vercel, Netlify and Heroku. - Dokploy/dokploy
Pharoh
Pharoh13mo ago
yeah
#!/bin/bash

# Determine the type of build based on the first script argument
BUILD_TYPE=${1:-production}

if [ "$BUILD_TYPE" == "canary" ]; then
TAG="canary"
else
VERSION=$(node -p "require('./package.json').version")
TAG="$VERSION"
fi

docker build --platform linux/amd64 --pull --rm -f 'Dockerfile' -t "dokploy/dokploy:${TAG}" .
docker build --platform linux/arm64 --pull --rm -f 'Dockerfile' -t "dokploy/dokploy:${TAG}-arm64" .

if [ "$BUILD_TYPE" != "canary" ]; then
# Tag the production build as latest
docker tag "dokploy/dokploy:${TAG}" "dokploy/dokploy:latest"
fi
#!/bin/bash

# Determine the type of build based on the first script argument
BUILD_TYPE=${1:-production}

if [ "$BUILD_TYPE" == "canary" ]; then
TAG="canary"
else
VERSION=$(node -p "require('./package.json').version")
TAG="$VERSION"
fi

docker build --platform linux/amd64 --pull --rm -f 'Dockerfile' -t "dokploy/dokploy:${TAG}" .
docker build --platform linux/arm64 --pull --rm -f 'Dockerfile' -t "dokploy/dokploy:${TAG}-arm64" .

if [ "$BUILD_TYPE" != "canary" ]; then
# Tag the production build as latest
docker tag "dokploy/dokploy:${TAG}" "dokploy/dokploy:latest"
fi
@Siumauricio will this work?
Nefnief
Nefnief13mo ago
so for me it worked
if command_exists docker; then
echo "Docker already installed"
else
curl -sSL https://get.docker.com | sh
fi

docker swarm leave --force 2>/dev/null
docker swarm init --advertise-addr 127.0.0.1 --listen-addr 0.0.0.0;

echo "Swarm initialized"

docker network rm -f dokploy-network 2>/dev/null
docker network create --driver overlay --attachable dokploy-network

echo "Network created"

mkdir -p /etc/dokploy

chmod -R 777 /etc/dokploy

docker pull dokploy/dokploy:latest

# Installation
docker service create \
--name dokploy \
--replicas 1 \
--network dokploy-network \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
--publish published=3000,target=3000,mode=host \
--update-parallelism 1 \
--update-order stop-first \
dokploy/dokploy:latest-arm64
if command_exists docker; then
echo "Docker already installed"
else
curl -sSL https://get.docker.com | sh
fi

docker swarm leave --force 2>/dev/null
docker swarm init --advertise-addr 127.0.0.1 --listen-addr 0.0.0.0;

echo "Swarm initialized"

docker network rm -f dokploy-network 2>/dev/null
docker network create --driver overlay --attachable dokploy-network

echo "Network created"

mkdir -p /etc/dokploy

chmod -R 777 /etc/dokploy

docker pull dokploy/dokploy:latest

# Installation
docker service create \
--name dokploy \
--replicas 1 \
--network dokploy-network \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
--publish published=3000,target=3000,mode=host \
--update-parallelism 1 \
--update-order stop-first \
dokploy/dokploy:latest-arm64
Raphael
RaphaelOP13mo ago
did u create the image localy?
Nefnief
Nefnief13mo ago
yes but then the node wont work
Raphael
RaphaelOP13mo ago
what do you mean?
Nefnief
Nefnief13mo ago
so its says the node isnt suitable
Raphael
RaphaelOP13mo ago
then you are not using the right image
Nefnief
Nefnief13mo ago
im using an arm64 oracle vm
Raphael
RaphaelOP13mo ago
yes but then you are not using the arm image when starting the service
Nefnief
Nefnief13mo ago
its aarm64
Raphael
RaphaelOP13mo ago
did you do all of this?
Nefnief
Nefnief13mo ago
docker buildx build --platform linux/aarch64 -t dokploy/dokploy:latest-aarch64 --load . this is my build command for the aarch64
Raphael
RaphaelOP13mo ago
well then u need to modify the service start aswell to use aarch64 instead of arm64
Nefnief
Nefnief13mo ago
yes ill change the prod.sh
Raphael
RaphaelOP13mo ago
docker service create \
--name dokploy \
--replicas 1 \
--network dokploy-network \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
--publish published=3000,target=3000,mode=host \
--update-parallelism 1 \
--update-order stop-first \
dokploy/dokploy:latest-aarch64
docker service create \
--name dokploy \
--replicas 1 \
--network dokploy-network \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
--publish published=3000,target=3000,mode=host \
--update-parallelism 1 \
--update-order stop-first \
dokploy/dokploy:latest-aarch64
like this
Nefnief
Nefnief13mo ago
got it
Raphael
RaphaelOP13mo ago
u changed the image name, so u need to adjust it in the run function aswell but i dont even get why u need to change it arm64 is aarch64 😄
Nefnief
Nefnief13mo ago
where is the run function?
Raphael
RaphaelOP13mo ago
just copy what i did above u can use arm64 it will work just do the steps one by one
Nefnief
Nefnief13mo ago
i did
Raphael
RaphaelOP13mo ago
no u changed the docker build command to aarch64 instead of arm64
Nefnief
Nefnief13mo ago
yeah now after i tried yours
Raphael
RaphaelOP13mo ago
well if u want to do it with aarch64 u need to update prod.sh to use this
Nefnief
Nefnief13mo ago
its says perepaing then raedy and then preparing again
No description
Nefnief
Nefnief13mo ago
i did
Raphael
RaphaelOP13mo ago
well then just wait i guess?
Nefnief
Nefnief13mo ago
im waiting i say if its working
Nefnief
Nefnief13mo ago
its in like a loop
No description
Raphael
RaphaelOP13mo ago
GitHub
feat: Update build.sh to provide arm64, aarch64 and x86 images by m...
Updating build, so it gets build for arm64 aarch64 and the normal x86, using buildx automatically pushing the new images to the registry see docs here Nothing else needs to change as docker automat...
Raphael
RaphaelOP13mo ago
well yeah u using dokploy:dokploy and not the aarch image
Siumauricio
Siumauricio13mo ago
Thanks! I will try to review as soon as i can
Raphael
RaphaelOP13mo ago
yes and test if the images get successfully pushed to the registry, i am unsure if it works out of the box 😄
Nefnief
Nefnief13mo ago
i dont understand it is aarch64 in my prod.sh
Raphael
RaphaelOP13mo ago
well maybe ur old service is still running stop it, delete it and start it new
Nefnief
Nefnief13mo ago
nothings running
No description
Raphael
RaphaelOP13mo ago
service not container
docker service stop dokploy
docker service stop dokploy
docker service rm dokploy
docker service rm dokploy
then start i again
Nefnief
Nefnief13mo ago
there is no dockploy running
Raphael
RaphaelOP13mo ago
dokploy not dockploy
Nefnief
Nefnief13mo ago
i now i copied your coomands
Pharoh
Pharoh13mo ago
lmao
Raphael
RaphaelOP13mo ago
check the name then
docker service ls
docker service ls
Nefnief
Nefnief13mo ago
none
Nefnief
Nefnief13mo ago
No description
Pharoh
Pharoh13mo ago
do docker ps
Raphael
RaphaelOP13mo ago
what command are you using to restart it the whole process
Nefnief
Nefnief13mo ago
sh prod.sh
Raphael
RaphaelOP13mo ago
can u send the content of prod.sh?
Nefnief
Nefnief13mo ago
#!/bin/bash

if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" >&2
exit 1
fi

# check if is Mac OS
if [ "$(uname)" = "Darwin" ]; then
echo "This script must be run on Linux" >&2
exit 1
fi


# check if is running inside a container
if [ -f /.dockerenv ]; then
echo "This script must be run on Linux" >&2
exit 1
fi

# check if something is running on port 80
if ss -tulnp | grep ':80 ' >/dev/null; then
echo "Error: something is already running on port 80" >&2
exit 1
fi

# check if something is running on port 443
if ss -tulnp | grep ':443 ' >/dev/null; then
echo "Error: something is already running on port 443" >&2
exit 1
fi






command_exists() {
command -v "$@" > /dev/null 2>&1
}

if command_exists docker; then
echo "Docker already installed"
else
curl -sSL https://get.docker.com | sh
fi

docker swarm leave --force 2>/dev/null
docker swarm init --advertise-addr 127.0.0.1 --listen-addr 0.0.0.0;

echo "Swarm initialized"

docker network rm -f dokploy-network 2>/dev/null
docker network create --driver overlay --attachable dokploy-network

echo "Network created"

mkdir -p /etc/dokploy

chmod -R 777 /etc/dokploy

docker pull dokploy/dokploy:latest

# Installation
docker service create \
--name dokploy \
--replicas 1 \
--network dokploy-network \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
--publish published=3000,target=3000,mode=host \
--update-parallelism 1 \
--update-order stop-first \
dokploy/dokploy:latest-aarch64

public_ip=$(hostname -I | awk '{print $1}')

GREEN="\033[0;32m"
YELLOW="\033[1;33m"
BLUE="\033[0;34m"
NC="\033[0m" # No Color


echo ""
printf "${GREEN}Congratulations, Dokploy is installed!${NC}\n"
printf "${BLUE}Wait 15 seconds for the server to start${NC}\n"
printf "${YELLOW}Please go to http://${public_ip}:3000${NC}\n\n"
echo ""
#!/bin/bash

if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" >&2
exit 1
fi

# check if is Mac OS
if [ "$(uname)" = "Darwin" ]; then
echo "This script must be run on Linux" >&2
exit 1
fi


# check if is running inside a container
if [ -f /.dockerenv ]; then
echo "This script must be run on Linux" >&2
exit 1
fi

# check if something is running on port 80
if ss -tulnp | grep ':80 ' >/dev/null; then
echo "Error: something is already running on port 80" >&2
exit 1
fi

# check if something is running on port 443
if ss -tulnp | grep ':443 ' >/dev/null; then
echo "Error: something is already running on port 443" >&2
exit 1
fi






command_exists() {
command -v "$@" > /dev/null 2>&1
}

if command_exists docker; then
echo "Docker already installed"
else
curl -sSL https://get.docker.com | sh
fi

docker swarm leave --force 2>/dev/null
docker swarm init --advertise-addr 127.0.0.1 --listen-addr 0.0.0.0;

echo "Swarm initialized"

docker network rm -f dokploy-network 2>/dev/null
docker network create --driver overlay --attachable dokploy-network

echo "Network created"

mkdir -p /etc/dokploy

chmod -R 777 /etc/dokploy

docker pull dokploy/dokploy:latest

# Installation
docker service create \
--name dokploy \
--replicas 1 \
--network dokploy-network \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
--publish published=3000,target=3000,mode=host \
--update-parallelism 1 \
--update-order stop-first \
dokploy/dokploy:latest-aarch64

public_ip=$(hostname -I | awk '{print $1}')

GREEN="\033[0;32m"
YELLOW="\033[1;33m"
BLUE="\033[0;34m"
NC="\033[0m" # No Color


echo ""
printf "${GREEN}Congratulations, Dokploy is installed!${NC}\n"
printf "${BLUE}Wait 15 seconds for the server to start${NC}\n"
printf "${YELLOW}Please go to http://${public_ip}:3000${NC}\n\n"
echo ""
Raphael
RaphaelOP13mo ago
well it should work 😄 idk man :/
Nefnief
Nefnief13mo ago
Nefnief
Nefnief13mo ago
this loops
Raphael
RaphaelOP13mo ago
maybe clean your system and start from scratch?
Nefnief
Nefnief13mo ago
yeah thats not possible as ive got many other important services running
Raphael
RaphaelOP13mo ago
remove all images that are used from dokploy and all containers and all services then basically everything that got added from dokploy and start again are you on hetzner? or what vps are you using
Nefnief
Nefnief13mo ago
oracle
Raphael
RaphaelOP13mo ago
try it again with arm? instead of aarch? idk
Nefnief
Nefnief13mo ago
seams to have the same issue
Raphael
RaphaelOP13mo ago
last thing i can think of is removing the mount before u run it again otherwise i dont know
Nefnief
Nefnief13mo ago
its empty
Raphael
RaphaelOP13mo ago
then i dont know maybe @Siumauricio has an idea
Siumauricio
Siumauricio13mo ago
I'm running the changes from the PR locally, just wait! I pushed a build for ARM in canary tag you can try with this command, i tested and it was working fine, in a few will be available! curl -sSL https://dokploy.com/canary.sh | sh
Nefnief
Nefnief13mo ago
so it works but for me the installation doesnt work as the installer is looping
Nefnief
Nefnief13mo ago
Nefnief
Nefnief13mo ago
after i installed and reinstalled the conatiner it starts looping how to recreate: install dokploy uninmtsall it as shown in the docs and reinstall
Nefnief
Nefnief13mo ago
and when running
docker service ls
docker service ls
No description
Nefnief
Nefnief13mo ago
so treaFIK AND OTHER NEEDED SERVICES ARENT CREATED
Nefnief
Nefnief13mo ago
No description
Siumauricio
Siumauricio13mo ago
@Nefnief what vps provider are you using? I tested on a hetzner vps and it was working
Nefnief
Nefnief13mo ago
Oracle cloud free Ampere
Siumauricio
Siumauricio13mo ago
Im trying to create a ampere but there is not availability right now 😦
No description
Nefnief
Nefnief13mo ago
true so im not able to start from scratch
Siumauricio
Siumauricio13mo ago
I tried this instance and it was working, since ampere is not available now i cannot test
No description
Siumauricio
Siumauricio13mo ago
No description
Nefnief
Nefnief13mo ago
for me it gives me this erro when using this type of vm
No description
Siumauricio
Siumauricio13mo ago
can you please try this? docker service scale dokploy=0 docker service scale dokploy=1 in the terminal? and then do docker service logs dokploy and pass me the logs
Nefnief
Nefnief13mo ago
is looping again the logs are empty
Nefnief
Nefnief13mo ago
No description
Siumauricio
Siumauricio13mo ago
do docker service ls
Nefnief
Nefnief13mo ago
No description
Siumauricio
Siumauricio13mo ago
try docker ps
Nefnief
Nefnief13mo ago
nothing from dokploy
Siumauricio
Siumauricio13mo ago
hmm really weird tbh, do you have anything else running on the server?
Nefnief
Nefnief13mo ago
yeah, verry mouch
Siumauricio
Siumauricio13mo ago
have you tried to run on a fresh vps?
Nefnief
Nefnief13mo ago
yeah the small amd but with 22.04 linux now im trying with 20.04
Siumauricio
Siumauricio13mo ago
This?
No description
Nefnief
Nefnief13mo ago
no this
No description
Siumauricio
Siumauricio13mo ago
Previosly i tried that, and it was working
Nefnief
Nefnief13mo ago
ok ill see its installing http://130.61.121.97:3000/ try it doesnt work
Siumauricio
Siumauricio13mo ago
try this again please? docker service scale dokploy=0 docker service scale dokploy=1 I tried on that specific machine and it was working hmmm also another thing did you run the command on root mode?
Nefnief
Nefnief13mo ago
yes
Siumauricio
Siumauricio13mo ago
do docker service ls
Nefnief
Nefnief13mo ago
No description
Siumauricio
Siumauricio13mo ago
ok please jus try this again docker service scale dokploy=0 docker service scale dokploy=1
Nefnief
Nefnief13mo ago
No description
Siumauricio
Siumauricio13mo ago
ok now do docker service logs dokploy
Nefnief
Nefnief13mo ago
works
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy | > [email protected] start /app
dokploy.1.vt2spulhqh35@dokploy | > node dist/server.mjs
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy | Default middlewares already exists
dokploy.1.vt2spulhqh35@dokploy | Swarm is already initilized
dokploy.1.vt2spulhqh35@dokploy | Network is already initilized
dokploy.1.vt2spulhqh35@dokploy | Main config already exists
dokploy.1.vt2spulhqh35@dokploy | Default traefik config already exists
dokploy.1.vt2spulhqh35@dokploy | Traefik Started ✅
dokploy.1.vt2spulhqh35@dokploy | Redis Started ✅
dokploy.1.vt2spulhqh35@dokploy | Postgres Started ✅
dokploy.1.vt2spulhqh35@dokploy | Setting up cron jobs....
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy | Dokploy server is up and running!
dokploy.1.vt2spulhqh35@dokploy | Please wait for 15 seconds before opening the browser.
dokploy.1.vt2spulhqh35@dokploy | http://130.61.121.97:3000
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy | Migration complete
dokploy.1.vt2spulhqh35@dokploy | Server Started: 3000
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy | > [email protected] start /app
dokploy.1.vt2spulhqh35@dokploy | > node dist/server.mjs
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy | Default middlewares already exists
dokploy.1.vt2spulhqh35@dokploy | Swarm is already initilized
dokploy.1.vt2spulhqh35@dokploy | Network is already initilized
dokploy.1.vt2spulhqh35@dokploy | Main config already exists
dokploy.1.vt2spulhqh35@dokploy | Default traefik config already exists
dokploy.1.vt2spulhqh35@dokploy | Traefik Started ✅
dokploy.1.vt2spulhqh35@dokploy | Redis Started ✅
dokploy.1.vt2spulhqh35@dokploy | Postgres Started ✅
dokploy.1.vt2spulhqh35@dokploy | Setting up cron jobs....
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy | Dokploy server is up and running!
dokploy.1.vt2spulhqh35@dokploy | Please wait for 15 seconds before opening the browser.
dokploy.1.vt2spulhqh35@dokploy | http://130.61.121.97:3000
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy |
dokploy.1.vt2spulhqh35@dokploy | Migration complete
dokploy.1.vt2spulhqh35@dokploy | Server Started: 3000
Siumauricio
Siumauricio13mo ago
Yeah there is a condition race there, i need to figure out how to fix this but i have an idea, this issue happens only in low specs vps
Siumauricio
Siumauricio13mo ago
this could be the issue, we are deploying the database as the last resource https://github.com/Dokploy/dokploy/blob/canary/server/server.ts#L53 maybe moving to the start this issue can be removed
GitHub
dokploy/server/server.ts at canary · Dokploy/dokploy
Open Source Alternative to Vercel, Netlify and Heroku. - Dokploy/dokploy
Nefnief
Nefnief13mo ago
so another issue is that after the reinstall it gets bricked and wont be able to redeploy so i tested it and it doesnt work on a machine where it was previously installed and the reinstalled
Siumauricio
Siumauricio13mo ago
What do you mean on this ?
Nefnief
Nefnief13mo ago
No description
Nefnief
Nefnief13mo ago
after i tried to install dokdeploy on ma big armk server and it didnt work i made my own image but then it started looping eaven thoug i followed the uninstall section now with the canary it still has the same issue, that it fails to install
Siumauricio
Siumauricio13mo ago
ok but that is happenin on ampere server right?
Nefnief
Nefnief13mo ago
yes
Siumauricio
Siumauricio13mo ago
Ok, I need to try, but first i need to be able to create that server and currently is not available on oracle cloud due to disponibility
Nefnief
Nefnief13mo ago
it also works on the amd one no it doesnt it reinstalls just fine

Did you find this page helpful?