Product docs and API reference are now on Akamai TechDocs.
Search product docs.
Search for “” in product docs.
Search API reference.
Search for “” in API reference.
Search Results
 results matching 
 results
No Results
Filters
Install Caddy on Arch Linux
Traducciones al EspañolEstamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Before You Begin
Familiarize yourself with the Getting Started guide and complete the steps for setting your Linode’s hostname and timezone .
Complete the sections of the Securing Your Server guide to create a standard user account and harden SSH access .
Register (purchase) your site’s domain name and follow our Manage DNS Records guide to point the domain to your Linode.
Update your system:
sudo pacman -Syu
What is Caddy?
Caddy is an open source HTTP/2 capable web server with automatic HTTPS written in Go . It supports a variety of web site technologies, includes security defaults, and is very easy to use.
Install Caddy
You can install Caddy on Arch Linux by using the caddy package. It comes with both of Caddy’s systemd service unit files, but does not enable them by default.
sudo pacman -Syu caddy
Allow HTTP and HTTPS Connections
Caddy serves websites using HTTP and HTTPS protocols, so you need to allow access to the ports 80, and 443.
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
Add Web Content
Set up a home directory, web root, for your website:
sudo mkdir -p /var/www/html/example.com
Create a test page:
echo '<!doctype html><head><title>Caddy Test Page</title></head><body><h1>Hello, World!</h1></body></html>' > /var/www/html/example.com/index.html
Configure the Caddyfile
Add your hostname and web root to the Caddy configuration. Use an editor of your choice and replace :80
with your domain name. Set the root directory of the site to /var/www/html/example.com
Replace example.com
with your site’s domain name:
- File: /etc/caddy/Caddyfile
1 2 3 4
example.com { root * /var/www/html/example.com file_server }
Start and Enable the Caddy Service
Enable the Caddy service:
sudo systemctl start caddy
Verify that the service is active:
sudo systemctl status caddy
An output similar to the following appears:
● caddy.service - Caddy Loaded: loaded (/usr/lib/systemd/system/caddy.service; disabled; vendor preset: disabled) Active: active (running) since Thu 2021-09-02 18:25:29 IST; 4s ago Docs: https://caddyserver.com/docs/ Main PID: 19314 (caddy) CGroup: /system.slice/caddy.service └─19314 /usr/bin/caddy run --environ --config /etc/caddy/Caddyfile... Sep 02 18:25:29 caddy caddy[19314]: SHELL=/sbin/nologin Sep 02 18:25:29 caddy caddy[19314]: {"level":"info","ts":1630587329.1270738..."} Sep 02 18:25:29 caddy systemd[1]: Started Caddy. Sep 02 18:25:29 caddy caddy[19314]: {"level":"info","ts":1630587329.1316314...]} Sep 02 18:25:29 caddy caddy[19314]: {"level":"info","ts":1630587329.1317837...0} Sep 02 18:25:29 caddy caddy[19314]: {"level":"info","ts":1630587329.1324193..."} Sep 02 18:25:29 caddy caddy[19314]: {"level":"info","ts":1630587329.1324632..."} Sep 02 18:25:29 caddy caddy[19314]: {"level":"info","ts":1630587329.1325648..."} Sep 02 18:25:29 caddy caddy[19314]: {"level":"info","ts":1630587329.1326034..."} Sep 02 18:25:29 caddy caddy[19314]: {"level":"info","ts":1630587329.1326299..."} Hint: Some lines were ellipsized, use -l to show in full.
To check the latest logs without truncation use
sudo journalctl -u caddy --no-pager | less +G
.Open a web browser and visit your domain. You should see the contents of the
index.html
page that you created in the Add Web Content section .
More Information
You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.
This page was originally published on