Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To host a website with Caddy, point your domain’s DNS records at a Linux VPS, allow inbound TCP ports 80 and 443, install Caddy from the distribution’s official package, and place a small site definition in /etc/caddy/Caddyfile. Caddy then obtains and renews a publicly trusted HTTPS certificate automatically for the public hostname and redirects HTTP traffic to HTTPS.

The same server can deliver files directly or act as a reverse proxy for an application listening on a private port. The configurations are short, but DNS, firewall reachability, service permissions, and the backend listener must all be correct.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the finished setup looks like

A browser requests https://example.com. DNS resolves that name to the VPS address. The VPS firewall allows the connection to Caddy on port 443 (and port 80 for the normal certificate-validation and redirect flow). Caddy terminates TLS and either reads files from the server or forwards the request to an application process on a local address such as 127.0.0.1:9000.

The application does not need to be exposed directly to the internet. In a reverse-proxy deployment, only Caddy’s public listener is exposed; the backend can remain on localhost or another private interface. Caddy’s reverse_proxy directive can later fan requests out to several upstreams and perform active or passive health checks.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Prerequisites and decisions

A VPS with public reachability

Choose a Linux VPS that has a public IPv4 address, a public IPv6 address if you intend to publish an AAAA record, or both. You need administrative access to install packages, edit the Caddyfile, and configure host and provider firewalls.

A registered domain you control

Use a hostname you can edit in the authoritative DNS service. Caddy’s normal public certificate flow requires a public hostname rather than an unresolvable internal name.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Decide whether Caddy serves files or proxies an app

  • Static site: Caddy reads HTML, CSS, JavaScript, images, and other assets from a directory on the VPS.
  • Application site: A separate process generates responses, and Caddy forwards requests to that process.

This choice determines the site block, the process-management work you must do, and whether you need upstream health checks or load balancing later.

Point DNS at the VPS before starting Caddy

Create the address records

At your DNS provider, create an A record for the hostname pointing to the VPS’s public IPv4 address. If the server has public IPv6, create an AAAA record pointing to that address as well. Use the exact hostname that will appear in your Caddyfile; for a root domain that may be example.com, while a subdomain might be www.example.com or app.example.com.

Verify authoritative answers

Do not rely only on the DNS provider’s control panel showing a saved record. Query an authoritative DNS service and confirm that the address returned for the hostname is the VPS address. If an old A or AAAA record still points to another machine, browsers and certificate authorities can reach the wrong host even though the Caddy configuration is correct.

Allow time for caches to expire when you have changed an existing record. During this period, test the exact hostname and check both address families if you published both record types.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Open the two public ports

Provider-level firewall

In the VPS provider’s security group, network ACL, or firewall panel, allow inbound TCP connections on ports 80 and 443 from the internet. The rules must direct those ports to the VPS running Caddy.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Linux host firewall

Make the same allowance in the operating system firewall. The provider rule and the host rule are independent: opening a port in one does not override a deny rule in the other. Keep your administrative SSH rule in place so that changing web-firewall rules does not lock you out.

Port 80 is needed for the normal public ACME validation path and for Caddy’s HTTP-to-HTTPS redirect. Port 443 carries normal encrypted browser traffic. If either port is blocked, certificate issuance, renewal, or browser access can fail even when DNS is correct.

Install Caddy as a production service

Use the official Caddy package for your Linux distribution when one is available. The official installation guidance recommends the package and strongly recommends running Caddy as a system service on production machines. A packaged systemd installation supplies a predictable service account, startup integration, and a standard location for the main configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Confirm the service layout

With the packaged service, put the main configuration in /etc/caddy/Caddyfile. Keep site content and application code in directories whose permissions allow the Caddy service to read what it must serve, while avoiding unnecessary write access.

After installation, confirm that the service is installed and that the caddy executable is available. Distribution package names and repository setup differ, so use the package instructions for the specific Linux release rather than mixing instructions from another distribution.

Host a static website

Prepare the document root

Create a directory such as /var/www/example and place an index.html file and the rest of the site’s assets inside it. Ensure the Caddy service account can traverse the parent directories and read the files. A permission problem normally appears as a denied response or missing assets, not as a DNS error.

Write the site block

For a public hostname and files in that directory, use:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
example.com {
    root * /var/www/example
    file_server
}

The hostname on the first line is the name visitors use. The root directive selects the filesystem directory, and file_server enables static-file responses. Keep the hostname exactly aligned with the DNS record and the address users will enter.

Use the one-command alternative for a quick test

Caddy also provides a command-line file server:

caddy file-server --domain example.com

This is useful for a temporary or exploratory deployment. For a persistent VPS, the Caddyfile managed by the system service is easier to validate, reload, and maintain after reboots.

Expose an application through a reverse proxy

Start and test the backend privately

Run the application on a known local address and port, for example 127.0.0.1:9000. Confirm that the process is actually listening there before involving Caddy. If the app listens on a different port, Unix socket, or interface, use that real endpoint in the proxy configuration.

Use the minimal proxy block

Put this in /etc/caddy/Caddyfile:

example.com {
    reverse_proxy 127.0.0.1:9000
}

Caddy receives the public request, handles HTTPS, and forwards it to the local backend. The backend port does not need an internet-facing firewall rule when it is bound only to localhost.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the one-command alternative

For a quick deployment, Caddy’s reverse-proxy command is:

caddy reverse-proxy --from example.com --to localhost:9000

Use the service-managed Caddyfile for a production site so the definition survives a shell session ending and can be reloaded consistently.

Plan for the backend process

Caddy is the web entry point; it does not replace the application process manager. Arrange for the backend to start at boot, restart after a crash, and write logs somewhere you can inspect. The exact process manager depends on the application and Linux distribution. Caddy can only proxy what is running and reachable at the configured upstream.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Validate and reload safely

Check the configuration before applying it

After editing the Caddyfile, validate its syntax with Caddy’s validation command or the validation option provided by your installed service tooling. Fix syntax errors before attempting a reload; an invalid replacement should not displace a working configuration.

Reload instead of stopping the service

Reload Caddy after a successful validation so active connections can continue while the new site definition is applied. The packaged systemd service is the normal production path for this operation. A full stop and start is rarely necessary for an ordinary Caddyfile change.

Test from outside the VPS

  1. Resolve the hostname and confirm the returned A and AAAA addresses match the VPS.
  2. Request the HTTP URL and verify that it redirects to the HTTPS URL.
  3. Open the HTTPS URL and verify the certificate is for the requested public hostname.
  4. For a static site, check the index page and representative assets.
  5. For an application, exercise a route that proves the request reached the backend.

How Caddy’s automatic HTTPS works

When a public hostname is present in the configuration, Caddy uses HTTPS by default. It obtains a certificate from a public ACME certificate authority, manages the certificate renewal process, and installs an HTTP-to-HTTPS redirect. You do not normally write a separate certificate-renewal job.

The normal public flow depends on two facts established earlier: public DNS must resolve the hostname to this server, and the internet must be able to reach ports 80 and 443. A certificate authority that reaches another machine, or cannot reach the validation endpoint because a firewall blocks it, cannot complete issuance for this VPS.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Public names versus localhost

A public hostname can receive a publicly trusted certificate when the validation requirements are met. A name such as localhost is different: Caddy uses a self-signed certificate for local development, so browsers will warn that it is not publicly trusted. Do not use a localhost certificate as evidence that your public DNS or firewall setup works.

Static hosting and reverse proxying compared

Concern Static file server Reverse proxy
Where responses come from Files read directly from the VPS document root. A separate application process behind Caddy.
Typical Caddy block root plus file_server. reverse_proxy plus one or more upstream addresses.
Backend process None required beyond Caddy. Must be started, supervised, updated, and monitored separately.
Internet exposure Caddy’s ports 80 and 443 are public. Caddy’s ports 80 and 443 are public; the backend can remain on localhost.
Scaling path Usually file deployment and caching concerns. Multiple upstreams, load balancing, and active or passive health checks are available.
Operational complexity Lower: fewer moving parts. Higher: an additional process and an upstream failure mode.

Choose static hosting when the VPS only needs to deliver files. Choose a reverse proxy when routes, sessions, server-side rendering, APIs, or another long-running application process must handle requests.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Moving from one backend to several

The simplest proxy target is a single upstream such as 127.0.0.1:9000. As you add application instances, list multiple upstreams in the reverse_proxy directive and choose an appropriate load-balancing policy supported by your Caddy version. Caddy’s reverse-proxy feature also supports active health checks, which periodically test whether an upstream is usable, and passive health checks, which react to observed failures.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Health checks are useful only when their test endpoint represents real readiness. A process that accepts a TCP connection but cannot serve the application can still receive traffic unless the health-check design detects that condition. Start with one upstream, verify the request path, then add instances and health checks deliberately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot by following the request path

The certificate is not issued

  • Check that the hostname’s A and AAAA records point to this VPS rather than an old address.
  • Confirm that TCP 80 and 443 are allowed both at the VPS provider and by the Linux host firewall.
  • Verify that Caddy is running and listening on the expected interfaces.
  • If an AAAA record exists but IPv6 is not actually reachable, correct the IPv6 setup or remove the stale record; clients and certificate authorities may prefer it.

The browser cannot connect

Start with DNS resolution, then test reachability to ports 80 and 443 from outside the VPS. A provider security-group rule can block traffic before it reaches Linux, while a host-firewall rule can block it after arrival. Distinguish those layers rather than changing the Caddyfile first.

Caddy returns an upstream connection error

The proxy target is not accepting connections at the address or port in the site block. Check the application’s listener, confirm whether it is bound to 127.0.0.1, another private address, or a socket, and make the reverse_proxy target match. Also check whether the application crashed or restarted between tests.

The site serves the wrong content

Verify that the request hostname matches the intended site block and that DNS no longer points to an earlier server. For static hosting, check the root path and file permissions. For proxying, confirm that the request is reaching the intended upstream rather than a different local process.

Manual Caddy startup cannot bind the web ports

Ports below 1024 normally require suitable privileges. The reverse-proxy documentation describes either running with the required privileges or granting the Caddy binary the cap_net_bind_service capability. On a production VPS, the packaged systemd service is the usual approach because it integrates the necessary service permissions and lifecycle management.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

HTTPS works locally but browsers warn on the public site

Localhost certificates are self-signed and are not publicly trusted. Test with the actual public hostname after DNS and firewall reachability are correct. A successful local request does not prove that a public ACME certificate was issued.

Operational checklist

  • The domain’s A and, when used, AAAA records resolve to the VPS.
  • Provider and Linux firewalls allow inbound TCP 80 and 443.
  • Caddy came from the distribution’s official package where available and runs as a system service.
  • The active configuration is in /etc/caddy/Caddyfile.
  • Static files are readable by the Caddy service account, or the application is listening at the configured upstream.
  • The Caddyfile validates before every reload.
  • HTTP redirects to HTTPS and the public certificate names the requested hostname.
  • The backend process, if present, starts reliably and has its own logging and restart plan.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.