Will Caddy run on RasperryPi Zero W v1.1?

I’ve looked, but can’t specifically find anyone saying that Caddy won’t run on an older RasperryPi Zero W v1.1

i.e. 32bit instead of 64bit OS

I’m guessing it’s as simple as that, but just wanted to make sure.

1. Caddy version (caddy version):

Latest

2. How I run Caddy:

That’s the problem, it’s not running

a. System environment:

Raspberry Pi Os Lite - 32 bit verion

b. Command:

sudo apt install caddy

c. Service/unit/compose file:

N/A

d. My complete Caddyfile or JSON config:

:80 {
        root * /usr/share/caddy
        file_server
}

3. The problem I’m having:

Caddy won’t start

4. Error messages and/or full log output:

user@pizero1w:~ $ systemctl status caddy.service
● caddy.service - Caddy
     Loaded: loaded (/lib/systemd/system/caddy.service; enabled; vendor preset: enabled)
     Active: failed (Result: signal) since Fri 2022-04-22 16:54:09 BST; 1min 12s ago
       Docs: https://caddyserver.com/docs/
   Main PID: 1740 (code=killed, signal=ILL)
        CPU: 89ms

Apr 22 16:54:08 pizero1w systemd[1]: Starting Caddy...
Apr 22 16:54:09 pizero1w systemd[1]: caddy.service: Main process exited, code=killed, status=4/ILL
Apr 22 16:54:09 pizero1w systemd[1]: caddy.service: Failed with result 'signal'.
Apr 22 16:54:09 pizero1w systemd[1]: Failed to start Caddy.

5. What I already tried:

Tried Raspberry Pi Os Lite - 64 bit verion, but it doesn’t run on the pi zero W v1.1

6. Links to relevant resources:

Hi :wave:

  1. Running caddy version prints the exact version. Would be great if you could share that :slight_smile:
  2. How did you install caddy? Install — Caddy Documentation?
  3. Your Caddyfile looks good to me :slight_smile:

Please run journalctl --unit caddy --no-pager | less +G and share some logs.
In case you are unfamiliar with less: Navigate via arrow keys and exit via q :innocent:

Ah right, this might have to do with how “armv6” and “armv7” actually both also known as “armhf”, but Cloudsmith only supports “armhf”, so we have to pick one, and we decided to push armv7 builds to Cloudsmith. So if your device requires armv6 builds (which I think it does from a quick google search), then it won’t directly work with the apt repo, unfortunately.

To work around it, you’ll need to download a build from Download Caddy instead, and follow these instructions to replace the binary the apt repo provides with the one you downloaded: Package support files for custom builds for Debian/Ubuntu/Raspbian

2 Likes

Thanks for your feedeback, but my problem was that I wasn’t able to get caddy running at all.

However, now following @francislavoie’s advice, I’ve now got it running :slight_smile:

Excellent!

Thank you @francislavoie!

I followed your advice and got it working!

Gonna tinker for a while & then post back my exact steps.

Cheers!

1 Like

As suggested by @francislavoie, I downloaded the ‘Linux arm 6’ binary from Download Caddy using my PC.

  1. I couldn’t work out the correct URL to use on curl or wget, to download the ‘Linux arm 6’ binary straight to my Raspberry Pi Zero v1.1, so I ended up using FTP to upload the downloaded ‘caddy_linux_arm6’ from my PC to my Raspberry Pi Zero v1.1

  2. Now, with the ‘Linux arm 6’ binary on my Raspberry Pi Zero v1.1, I could follow the rest of the procedure here: Build from source — Caddy Documentation

  3. The first command failed: dpkg-divert: error: error checking ‘/usr/bin/caddy’: Permission denied

  4. Therefore sudo all the commands (worked for me):

  5. sudo dpkg-divert --divert /usr/bin/caddy.default --rename /usr/bin/caddy

  6. sudo mv ./caddy /usr/bin/caddy.custom

  7. sudo update-alternatives --install /usr/bin/caddy caddy /usr/bin/caddy.default 10

  8. sudo update-alternatives --install /usr/bin/caddy caddy /usr/bin/caddy.custom 50

  9. sudo systemctl start caddy

However, Caddy still failed to start, so I then

  1. sudo chmod 755 /usr/bin/caddy.custom

  2. sudo systemctl start caddy

  3. sudo systemctl status caddy

     Loaded: loaded (/lib/systemd/system/caddy.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-04-23 08:45:02 BST; 11s ago
       Docs: https://caddyserver.com/docs/
   Main PID: 748 (caddy)
      Tasks: 7 (limit: 415)
        CPU: 353ms
     CGroup: /system.slice/caddy.service
             └─748 /usr/bin/caddy run --environ --config /etc/caddy/Caddyfile

Apr 23 08:45:02 zero1w caddy[748]: JOURNAL_STREAM=8:30412
Apr 23 08:45:02 zero1w caddy[748]: {"level":"info","ts":1650699902.0177162,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
Apr 23 08:45:02 zero1w caddy[748]: {"level":"info","ts":1650699902.0801115,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["localhost:2019","[::1]:2019","127.0.0.1:2019"]}
Apr 23 08:45:02 zero1w caddy[748]: {"level":"info","ts":1650699902.0831895,"logger":"http","msg":"server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server","server_name":"srv0","http_port":80}
Apr 23 08:45:02 zero1w caddy[748]: {"level":"info","ts":1650699902.0900774,"msg":"autosaved config (load with --resume flag)","file":"/var/lib/caddy/.config/caddy/autosave.json"}
Apr 23 08:45:02 zero1w systemd[1]: Started Caddy.
Apr 23 08:45:02 zero1w caddy[748]: {"level":"info","ts":1650699902.1002073,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/var/lib/caddy/.local/share/caddy"}
Apr 23 08:45:02 zero1w caddy[748]: {"level":"info","ts":1650699902.117115,"logger":"tls","msg":"finished cleaning storage units"}
Apr 23 08:45:02 zero1w caddy[748]: {"level":"info","ts":1650699902.121881,"msg":"serving initial configuration"}
Apr 23 08:45:02 zero1w caddy[748]: {"level":"info","ts":1650699902.124075,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x33f8410"}```
1 Like

You can just right-click the Download button once you’ve made your selection and use that link directly. E.g. https://caddyserver.com/api/download?os=linux&arch=arm&arm=6&idempotency=83882779422945

Right, those steps assumed that the file already had executable permissions; FWIW, if a binary ever tells you “permission denied”, then you probably just need to do sudo chmod +x /usr/bin/caddy.custom. Using +x basically means “add executable permissions”. 755 is also fine though, in this case.

1 Like

Apologies, clicked delete on last post as I made a mistake. Tried to use curl again & it worked. Guess I must’ve been doing something wrong?

Anyway, all good now :slight_smile:

1 Like

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