[Solved] How to install caddy v2.2.0-rc.3?

1.System environment:
Debian 10,
new system and only installed caddy v2.1.1 by the official command code

2.What I already tried:
Following the official Documentation, step by step.
2.1
install caddy by the official auto-install command

root@ruvds-exdt2:~# echo “deb [trusted=yes] https://apt.fury.io/caddy/ /”
> | tee -a /etc/apt/sources.list.d/caddy-fury.list
deb [trusted=yes] https://apt.fury.io/caddy/ /
root@ruvds-exdt2:~# apt update


Fetched 2158 B in 2s (991 B/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
18 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
root@ruvds-exdt2:~# apt install caddy
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
caddy
0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.
Need to get 13.1 MB of archives.
After this operation, 36.9 MB of additional disk space will be used.
Get:1 https://apt.fury.io/caddy caddy 2.1.1 [13.1 MB]
Fetched 13.1 MB in 5s (2501 kB/s)
Selecting previously unselected package caddy.
(Reading database … 20993 files and directories currently installed.)
Preparing to unpack …/archives/caddy_2.1.1_amd64.deb …
Unpacking caddy (2.1.1) …
Setting up caddy (2.1.1) …
Created symlink /etc/systemd/system/multi-user.target.wants/caddy.service → /lib/systemd/system/caddy.service.
root@ruvds-exdt2:~# caddy version
v2.1.1 h1:X9k1+ehZPYYrSqBvf/ocUgdLSRIuiNiMo7CvyGUQKeA=

after this, the caddy version is v2.1.1
so, i think i probably need download the v2.2.0-rc.3 binary from github.

2.2
Download the “caddy_2.2.0-rc.3_linux_amd64.deb”
and try install it as the Documentation says.

root@ruvds-exdt2:~# curl -OL “https://github.com/caddyserver/caddy/releases/download/v2.2.0-rc.3/caddy_2.2.0-rc.3_linux_amd64.deb
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 656 100 656 0 0 1730 0 --:–:-- --:–:-- --:–:-- 1730
100 11.0M 100 11.0M 0 0 2766k 0 0:00:04 0:00:04 --:–:-- 3757k
root@ruvds-exdt2:~# mv caddy /usr/bin/
mv: cannot stat ‘caddy’: No such file or directory
root@ruvds-exdt2:~# ls
caddy_2.2.0-rc.3_linux_amd64.deb

3. Now
i’m so confused what next i should do to make the installation done correctly,

  1. should i just change the caddy binary name “caddy_2.2.0-rc.3_linux_amd64.deb” to “caddy”?
    to make the installation proceed

  2. should i uninstall the old version before i install the new version?

i’m so much a newbie i’m quite aware,
help, pleasssseeee

You can install the .deb by running this command:

sudo dpkg -i caddy_2.2.0-rc.3_linux_amd64.deb

We don’t publish non-final releases to the apt repo, but you can grab the .deb directly from github, as you did. Next time Caddy releases a stable version, it will install it on top of your current one, I think.

1 Like

Thank you, man. @ francislavoie
I’m so grateful for your good answers.

Just one more question.
before i run this command to install caddy 2.2

sudo dpkg -i caddy_2.2.0-rc.3_linux_amd64.deb

Do i need to uninstall or remove the old caddy file (v2.1) ?
or, i can just run this command and the old caddy and caddy files will be covered or removed automatically.

It’ll only replace your Caddy binary and service files. Your config won’t be touched. No need to uninstall first.

1 Like

Thank you!!!

hi @francislavoie , i think i’m still stuck on this for another problem.

Today i was going to set up and install caddy on another server.
but the normal way, auto-installation way didn’t work for me somehow,
so i have to try use another way which you taught me,
and it worked and succeeded, i appreciate that.

but new question is,
after i edit the /etc/caddy/Caddyfile and save it,
( Replace :80 with my domain name)
i reload it, systemctl reload caddy
and it gives me an error.

root@ruvds-pok2z:~# nano /etc/caddy/Caddyfile
root@ruvds-pok2z:~# systemctl reload caddy
Job for caddy.service failed.
See “systemctl status caddy.service” and “journalctl -xe” for details.

and then i check systemctl status caddy

root@ruvds-pok2z:~# systemctl status caddy
caddy.service - Caddy
Loaded: loaded (/lib/systemd/system/caddy.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-09-21 18:43:51 MSK; 31min ago
Docs: Welcome — Caddy Documentation
Process: 6124 ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile (code=exited, status=1/FAILURE)
Main PID: 5858 (caddy)
Tasks: 6 (limit: 531)
Memory: 10.7M
CGroup: /system.slice/caddy.service
`-5858 /usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.5233977,“logger”:“http”,“msg”:“server is lis
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.5244043,“msg”:“autosaved config”,“file”:”/va
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.5244224,“msg”:"serving initial configuration
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.5245705,“logger”:“tls.cache.maintenance”,"ms
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.524622,“logger”:“tls”,“msg”:"cleaned up stor
Sep 21 19:12:08 ruvds-pok2z systemd[1]: Reloading Caddy.
Sep 21 19:12:08 ruvds-pok2z caddy[6124]: {“level”:“info”,“ts”:1600704728.8811388,“msg”:“using provided configuration”
Sep 21 19:12:08 ruvds-pok2z caddy[6124]: reload: adapting config using caddyfile: server block 0, key 0 (:22.t3st.tk)
Sep 21 19:12:08 ruvds-pok2z systemd[1]: caddy.service: Control process exited, code=exited, status=1/FAILURE
Sep 21 19:12:08 ruvds-pok2z systemd[1]: Reload failed for Caddy.

and i tested my web, visited my site, it loaded,
but it’s not HTTPS, only HTTP.

Can you please give me a little more help,
My goal is making my site over HTTPS,
what else i have to do after i install caddy manually?
Thanks.

It’s unclear what’s going on.

Please run journalctl --no-pager -u caddy | less, then hit Shift+G to jump to the bottom, see what logs are there. Use arrow keys and/or pgup and pgdn keys to move around, q to exit.

And what’s your Caddyfile now?

1 Like

root@ruvds-pok2z:~# journalctl --no-pager -u caddy | less

– Logs begin at Mon 2020-09-21 17:41:50 MSK, end at Mon 2020-09-21 20:58:06 MSK. –
Sep 21 18:43:51 ruvds-pok2z systemd[1]: Started Caddy.
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: caddy.HomeDir=/var/lib/caddy
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: caddy.AppDataDir=/var/lib/caddy/.local/share/caddy
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: caddy.AppConfigDir=/var/lib/caddy/.config/caddy
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: caddy.ConfigAutosavePath=/var/lib/caddy/.config/caddy/autosave.json
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: caddy.Version=v2.2.0-rc.3
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: runtime.GOOS=linux
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: runtime.GOARCH=amd64
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: runtime.Compiler=gc
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: runtime.NumCPU=1
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: runtime.GOMAXPROCS=1
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: runtime.Version=go1.15.2
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: os.Getwd=/
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: LANG=C
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: HOME=/var/lib/caddy
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: LOGNAME=caddy
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: USER=caddy
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: INVOCATION_ID=bbea422a80ea45f0aa53bd374e789e4a
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: JOURNAL_STREAM=9:66338
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.5101883,“msg”:“using provided configuration”,“config_file”:“/etc/caddy/Caddyfile”,“config_adapter”:“”}
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.5231931,“logger”:“admin”,“msg”:“admin endpoint started”,“address”:“tcp/localhost:2019”,“enforce_origin”:false,“origins”:[“localhost:2019”,“[::1]:2019”,“127.0.0.1:2019”]}
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.5233977,“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}
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.5244043,“msg”:“autosaved config”,“file”:“/var/lib/caddy/.config/caddy/autosave.json”}
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.5244224,“msg”:“serving initial configuration”}
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.5245705,“logger”:“tls.cache.maintenance”,“msg”:“started background certificate maintenance”,“cache”:“0xc000482e00”}
Sep 21 18:43:51 ruvds-pok2z caddy[5858]: {“level”:“info”,“ts”:1600703031.524622,“logger”:“tls”,“msg”:“cleaned up storage units”}
Sep 21 19:12:08 ruvds-pok2z systemd[1]: Reloading Caddy.
Sep 21 19:12:08 ruvds-pok2z caddy[6124]: {“level”:“info”,“ts”:1600704728.8811388,“msg”:“using provided configuration”,“config_file”:“/etc/caddy/Caddyfile”,“config_adapter”:“”}
Sep 21 19:12:08 ruvds-pok2z caddy[6124]: reload: adapting config using caddyfile: server block 0, key 0 (:22.t3st.tk): determining listener address: parsing key: invalid port ‘22.t3st.tk’: strconv.Atoi: parsing “22.t3st.tk”: invalid syntax
Sep 21 19:12:08 ruvds-pok2z systemd[1]: caddy.service: Control process exited, code=exited, status=1/FAILURE
Sep 21 19:12:08 ruvds-pok2z systemd[1]: Reload failed for Caddy.
Sep 21 19:22:00 ruvds-pok2z systemd[1]: Reloading Caddy.
Sep 21 19:22:00 ruvds-pok2z caddy[6208]: {“level”:“info”,“ts”:1600705320.9862413,“msg”:“using provided configuration”,“config_file”:“/etc/caddy/Caddyfile”,“config_adapter”:“”}
Sep 21 19:22:00 ruvds-pok2z caddy[6208]: reload: adapting config using caddyfile: server block 0, key 0 (:22.t3st.tk): determining listener address: parsing key: invalid port ‘22.t3st.tk’: strconv.Atoi: parsing “22.t3st.tk”: invalid syntax
Sep 21 19:22:00 ruvds-pok2z systemd[1]: caddy.service: Control process exited, code=exited, status=1/FAILURE
Sep 21 19:22:00 ruvds-pok2z systemd[1]: Reload failed for Caddy.
(END)

GNU nano 3.2 /etc/caddy/Caddyfile

The Caddyfile is an easy way to configure your Caddy web server.

Unless the file starts with a global options block, the first

uncommented line is always the address of your site.

To use your own domain name (with automatic HTTPS), first make

sure your domain’s A/AAAA DNS records are properly pointed to

this machine’s public IP, then replace the line below with your

domain name.

:22.t3st.tk

Set this path to your site’s directory.

root * /var/www/html/22.t3st.tk

Enable the static file server.

file_server

Another common task is to set up a reverse proxy:

reverse_proxy localhost:8080

Or serve a PHP site through php-fpm:

php_fastcgi localhost:9000

Refer to the Caddy docs for more information:

The Caddyfile — Caddy Documentation

This is the error, there’s invalid syntax in your Caddyfile.

1 Like

OMG, the :
there is a :at the front of my domain

i deleted :, now it finally works

and my site is HTTPS now

THANK YOU MAN
i love YOU!!!

3 Likes

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