Categories
Tags
Actual AI Astro Backup Bookworm Budgeting Caddy Caddyfile Cloud Storage Cloudflare Compression Copilot Dashboard Data Hoarding Debian DeepSeek DNS Docker Docker Compose FFmpeg File Management Flatnotes Forgejo Format Disk GitHub Google Anaytics Homarr ImageMagick Instagram jdupes Kimai Link Shortener LinkStack Linktree Linux Lychee Mail Server Mailcow Misskey Movie Tracker Navidrome Networking Nextcloud Node.js NTFS NVM OpenSSL Password Manager Passwords Performance Photoprism Privacy RAM Reverse Proxy rsync Secure Erase Security Server Spotify SVG Swap Memory tar Time Management Time Tracker Traggo Twitter Uptime USB Drives Vaultwarden Vibe Coding Video VPN VPS Web Analytics Yamtrack YOURLS Zstandard
108 words
1 minutes
Setting Up .local Domains for Local Self-Hosted Apps with Caddy
Setting Up .local Domains for Local Self-Hosted Apps with Caddy
Learn how to configure a .local domain name for your local environment using Caddy.
Prerequisites
- A self-hosted app running locally on port 4321
- Caddy
Installation
Install Caddy:
sudo apt install caddy
Steps
1. Add new entry to /etc/hosts
Run sudo nano /etc/hosts.
Add 127.0.0.1 appname.local.
To add subdomains or multiple domains, you can list them on the same line separated by spaces: 127.0.0.1 appname1.local appname2.local subdomain.appname.local
You can also list them on separate lines:
127.0.0.1 appname.local
127.0.0.1 subdomain.appname.local
2. Configure Caddy
Add
http://appname.local {
reverse_proxy localhost:4321
}
Run sudo systemctl restart caddy
4. Access your app
Open your browser and go to http://appname.local. Your app is now running with a friendly domain name instead of manually entering 127.0.0.1:4321.
Setting Up .local Domains for Local Self-Hosted Apps with Caddy
https://blog.juyung.com/posts/en/2026/09/17/