0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Caddy を Ubuntu 26.04 にインストール

0
Last updated at Posted at 2026-05-31

こちらの指示の通りにインストールしました。

Debian, Ubuntu, Raspbian

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
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 chmod o+r /usr/share/keyrings/caddy-stable-archive-keyring.gpg
sudo chmod o+r /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

動作の確認

sudo systemctl status caddy
● caddy.service - Caddy
     Loaded: loaded (/usr/lib/systemd/system/caddy.service; enabled; preset: en>
     Active: active (running) since Sun 2026-05-31 11:26:44 JST; 4min 45s ago

ブラウザーでアクセス

image.png

設定ファイルの変更

ドキュメントルートの変更

/etc/caddy/Caddyfile
(省略)
    # root * /usr/share/caddy
    root * /var/www/html
(省略)

変更の反映

sudo systemctl reload caddy

PHP を使う

php8.5-fpm が動いていることを確認

$ sudo systemctl status php8.5-fpm
● php8.5-fpm.service - The PHP 8.5 FastCGI Process Manager
     Loaded: loaded (/usr/lib/systemd/system/php8.5-fpm.service; enabled; prese>
     Active: active (running) since Sun 2026-05-31 11:21:46 JST; 28min ago

設定ファイルに追加

/etc/caddy/Caddyfile
:80 {
	root * /var/www

	file_server

	php_fastcgi unix//var/run/php/php8.5-fpm.sock
}

変更の反映

sudo systemctl reload caddy
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?