Error when installing Caddy on Linode

1. Output of caddy version:

Unable to install

2. How I run Caddy:

I followed the updated instruction by linode here:

a. System environment:

Debian 11 (No docker)
Linux localhost 5.10.0-20-amd64 #1 SMP Debian 5.10.158-2 (2022-12-13) x86_64 GNU/Linux

b. Command:

was unable to run install as I get error

root@localhost:/var/www/html/opentoadvice.com# sudo apt update && sudo apt install caddy
Hit:1 http://mirrors.linode.com/debian bullseye InRelease
Hit:2 http://mirrors.linode.com/debian-security bullseye-security/updates InRelease
Hit:3 http://mirrors.linode.com/debian bullseye-updates InRelease
Get:4 https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease [7,505 B]
Err:4 https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABA1F9B8875A6661
Reading package lists... Done
W: GPG error: https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABA1F9B8875A6661
E: The repository 'https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

c. Service/unit/compose file:

none

d. My complete Caddy config:

3. The problem I’m having:

Cant install candy

4. Error messages and/or full log output:

root@localhost:/var/www/html/opentoadvice.com# sudo apt update && sudo apt install caddy
Hit:1 http://mirrors.linode.com/debian bullseye InRelease
Hit:2 http://mirrors.linode.com/debian-security bullseye-security/updates InRelease
Hit:3 http://mirrors.linode.com/debian bullseye-updates InRelease
Get:4 https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease [7,505 B]
Err:4 https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABA1F9B8875A6661
Reading package lists... Done
W: GPG error: https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABA1F9B8875A6661
E: The repository 'https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

5. What I already tried:

Ive tried getting caddy working on ubuntu, kali and have yet to get it working with SSL, this is the first time attempting debian 11

6. Links to relevant resources:

Is not the secure way to do , and not recommended, but you can try to download the binary directly.

If you are running amd64 platform, use wget to obtain it at (https://github.com/caddyserver/caddy/releases/download/v2.6.2/caddy_2.6.2_linux_arm64.deb)

and then dpkg -i caddy_2.6.2_linux_arm64.deb
don’t forget sudo if you need it

Please follow the guide at Install — Caddy Documentation instead.
There seems to be a slight nuance in the curl command the linode tutorial uses.

is not unusual. Some big names deploy similar installation method.
Nvidia is an example. Brave browser even have extensive installation page for Linux

@gyfer I appreciate the effort you’ve been putting in to answer questions lately. But I do want to say, we’d prefer it if you’d emphasize using our official documentation as a resource. Recommending to install the .deb manually isn’t the right answer when we have the correct installation instructions in our docs.

@Jason_Howard To clarify, the Linode guide is outdated and seemingly not maintained. Please always refer first to the official documentation, not third-party guides. We can’t control what third-party guides tell you to do, so we can’t guarantee that it’ll be correct. We keep our docs updated with the latest recommendations.

Honestly I have tried the official documentation but it has become quite frustrating getting it to work correctly, which is the reason I tried to follow the linode specific setup. I have tried multiple distributions with the official docs and no luck… can’t even get it to read the files in the directory or getting SSL to work regardless of what issuer I use. I have no idea what is going on with this, seems simple enough, numerous tutorials online that have been posted over the last couple months, followed the official docs, and still not sure whats going on

Alright, well start from the beginning. Try again with the instructions from the official docs. And we’ll go from there.

While we’re at it, please make sure the ownership and the permission bits on the keys files are proper.

If anyone can and have time to fill up the “question template” and fill it with details, why anyone would think the person haven’t go through the official doc ? And from the description, he seem pretty frustrating after trying at least 3 different Linux , and still can’t get it to work. And I did mentioned running .deb manually is NOT recommended.
Take me for an example, it has been 3 years, and my reverse_proxy is still kinda not really working. I will post it here some time when I get a chance , so everyone can learn. Cheers

if you stick on Debian, especially Ubuntu, worry not. I might not have the right answer immediately, but I do know many ways, and method that I know are wrong after numerous of trial and error. And yes, I did read the Doc many man many times

Those are not related things. We can’t make that assumption. Troubleshooting is about eliminating variables to reduce the possible problemset to as few things as possible. We need to avoid any kind of ambiguity, so that we’re on the same page. They didn’t explicitly say they tried the installation instructions from the docs in their original post, so I can’t assume that they did try it.

Sure, I get that. But frustration does not solve problems.

Right now, I have no idea what the problems were exactly, because all they posted were an attempt to use an unofficial guide, and a comment saying they’re frustrated. That’s all we have to go on. That’s not enough to push forwards without more details.

Yeah, I understand that. But that should be the last thing to recommend, after making sure they’ve tried the official installation instructions.

Yeah, please do open a topic to ask for help with that, then.

1 Like
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update 
sudo apt install caddy

run the above, line by line, post it here so we can diagnose where it goes wrong. Let’s break it down what each line mean.

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https

3 packages to install,

  1. debian-keyring
  2. debian-archive-keyring
  3. apt-transport-https

curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg

Obtaining GPG key info for Caddy to verify server / file authenticity

curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
Add new repository address for Caddy

We’ve seen this before and it turned out to be file permission issue. Please check the last comment here and double-check the perms.

I was able to get it working by adding adapter=caddyfile flag otherwise I get an error. I can run it manually and it works. Now my only issue is editing the sudo systemctl edit caddy as outlined here in order to update the service.

I have made the following additions and this doesn’t seem to be working upon restarting caddy or reloading it

[Service]
ExecStart=
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile --adapter caddyfile
ExecReload=
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile --force --adapter caddyfile

# Error without adapter flag caddyfile
2023/01/08 19:47:44.960 INFO    using provided configuration   
 {"config_file": "/etc/caddy/CadyFile", "config_adapter": ""}
Error: loading initial config: decoding request body: invalid character 'u' looking for beginnig of value

the config file:

unfractal.com {
root * /var/www/html/unfractal.com
file_server
}

opentoadvice.com {
root * /var/www/html/opentoadvice.com
file_server
}
1 Like

I’ve reached out to Linode before to get on them about old/misleading tutorials :disappointed:

As Han Solo says, “They told me they fixed it!”

That seems… odd. It should only be required if the file is not named Caddyfile (or does not start with Caddyfile) - case sensitive.

I think the problem is the name of your config file is misspelled. CadyFile.

1 Like

Hi Matt, thanks for pointing that out, that seems to have resolved things after renaming the config file and restarting. Thank you so much. Thank you everyone for your help with this issue

2 Likes

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