Caddy permission denied update binary

1. The problem I’m having:

i cant run my updated binary. I was running caddy binary with systemd service on ubuntu 22.04 on oracle free tier vps. I had this working before but wanted to update to the latest caddy version. So I used the download page and selected amd64 linux added my plugins and downloaded it to downloads. I Then
sudo chown root:root caddy
sudo mv caddy /usr/bin

2. Error messages and/or full log output:

Jun 15 23:41:08 ubuntu-22-04 systemd[1]: Starting Caddy...
░░ Subject: A start job for unit caddy.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit caddy.service has begun execution.
░░ 
░░ The job identifier is 2208720.
Jun 15 23:41:08 ubuntu-22-04 systemd[55895]: caddy.service: Failed to locate executable /usr/bin/caddy: Permission denied
░░ Subject: Process /usr/bin/caddy could not be executed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The process /usr/bin/caddy could not be executed and failed.
░░ 
░░ The error number returned by this process is ERRNO.
Jun 15 23:41:08 ubuntu-22-04 systemd[55895]: caddy.service: Failed at step EXEC spawning /usr/bin/caddy: Permission denied
░░ Subject: Process /usr/bin/caddy could not be executed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The process /usr/bin/caddy could not be executed and failed.
░░ 
░░ 
░░ Subject: Process /usr/bin/caddy could not be executed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The process /usr/bin/caddy could not be executed and failed.
░░ 
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The process /usr/bin/caddy could not be executed and failed.
░░ 
░░ The error number returned by this process is ERRNO.
Jun 15 23:41:08 ubuntu-22-04 systemd[1]: caddy.service: Main process exited, code=exited, status=203/EXEC
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ An ExecStart= process belonging to unit caddy.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 203.
Jun 15 23:41:08 ubuntu-22-04 systemd[1]: caddy.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit caddy.service has entered the 'failed' state with result 'exit-code'.
Jun 15 23:41:08 ubuntu-22-04 systemd[1]: Failed to start Caddy.
░░ Subject: A start job for unit caddy.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit caddy.service has finished with a failure.
░░ 
░░ The job identifier is 2208720 and the job result is failed.

3. Caddy version:

v2 have no idea what revison as i cant use caddy version on linux for some odd reason

4. How I installed and ran Caddy:

Systemd service binary

a. System environment:

Systemd

Linux Ubuntu 22.04 Oracle VPS

b. Command:

N/A

c. Service/unit/compose file:

# For using Caddy with a config file.
#
# Make sure the ExecStart and ExecReload commands are correct
# for your installation.
#
# See https://caddyserver.com/docs/install for instructions.
#
# WARNING: This service does not use the --resume flag, so if you
# use the API to make changes, they will be overwritten by the
# Caddyfile next time the service is restarted. If you intend to
# use Caddy's API to configure it, add the --resume flag to the
# `caddy run` command or use the caddy-api.service file instead.

[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target

[Service]
Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile --force
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateDevices=yes
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

d. My complete Caddy config:

#    reverse_proxy 10.254.0.1:2283
#    tls {
#        dns cloudflare api-token
#    }
#}
tv.movies4you.stream {
    reverse_proxy 192.168.1.111:8096
    tls {
        dns cloudflare api-token
    }
}
ha.movies4you.stream {
    reverse_proxy 192.168.1.46:8123
    tls {
        dns cloudflare api-token
    }
}
kitchen.movies4you.stream {
    reverse_proxy 192.168.1.111:9090
    tls {
        dns cloudflare api-token
    }
}
music.movies4you.stream {
    reverse_proxy 192.168.1.111:5050
    tls {
        dns cloudflare api-token
    }
}
photos.movies4you.stream {
    reverse_proxy 192.168.1.21:10020
    tls {
        dns cloudflare api-token
    }
}
adguard.movies4you.stream
    reverse_proxy 129.213.81.108:3000
    tls {
        dns cloudflare api-token
    }
}

5. Links to relevant resources:

caddy ls -l permissions in /usr/bin
image

caddy version error
image

I think your problem got solved on discord – needed to chmod +x the binary, and needed the correct build for your CPU architecture (arm64).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.