Black Friday: 40% off for life · BLACKFRIDAY40Claim →
crabsmith Get started
Browse documentation
← All documentation

Sites

On this page

A site maps a domain (and optional aliases) to a folder in /home/crab/<original-domain>, served by Caddy with automatic HTTPS.

Create a site

New site form with framework presets, domain, and repository options

Before creating a site, install Caddy on the server (and PHP or Node.js if your app needs them).

  1. Open your server's Sites tab and click New site.
  2. App: pick a preset (Laravel, Symfony, WordPress, CrabPHP, Next.js, Node.js, or Static) or choose a site type manually:
    • Static: serves plain files (with an optional single-page app fallback).
    • PHP: runs PHP-FPM from your web root (for example, public).
    • Proxy: forwards traffic to an app listening on a local port (Crabsmith assigns a free port starting at 8001 if left blank).
  3. Code: pick a connected GitHub repository and branch, paste a custom Git URL, or choose No repository. Deploy after creating defaults on for connected GitHub repos and off for custom URLs or no repository.
    • For a private custom Git repo, create the site first, copy its public key from Deployment → Deploy key, add it with read access at your Git host, use the SSH clone URL, and click Deploy now.
  4. Domain: enter your domain, or pick Free domain (available when your server address is an IPv4 address) to get <name>.<server-ip-with-dashes>.sslip.io without setting up DNS first.
  5. Run (Proxy presets): Run the app as a daemon is enabled by default so Crabsmith creates the app daemon and adds its restart command to your deploy script automatically.
  6. Click Create site.

Note

Site files always stay in /home/crab/<original-domain>. Renaming the domain or adding aliases later updates Caddy without moving the folder.

DNS and HTTPS

Choose one of three HTTPS modes in Settings:

  • Auto (default): Caddy fetches and renews public TLS certificates automatically. Point an A record for your domain (and each alias) at your server's public IPv4 address, and make sure inbound TCP ports 80 and 443 are open. (This also applies to Free domain—the server must be publicly reachable on ports 80 and 443 for Caddy to issue the certificate.)
  • Internal: uses Caddy's own local CA. Useful for private hostnames without public DNS (browsers will warn unless they trust the CA).
  • Off: serves plain HTTP. Use this for local testing or when sitting behind Cloudflare Flexible SSL (where Cloudflare connects to your server over HTTP).

Using Cloudflare

  • Full (Strict) SSL (recommended): keep your site's HTTPS mode on Auto. Point your DNS record to the server's IP first, wait a minute for Caddy to issue the initial certificate (or turn off the orange cloud briefly during initial setup if you use strict Cloudflare rules), then enable the Cloudflare proxy with Full (Strict) SSL.
  • Flexible SSL: Cloudflare connects to your origin over plain HTTP. Set your site's HTTPS mode to Off so Cloudflare and Caddy don't create a redirect loop.

Switching from a free domain to your own domain

  1. Point your domain's A record at your server's IP address.
  2. Open the site's Settings and replace the .sslip.io domain with your real domain (or add it as an alias).
  3. Click Save—Caddy updates its config and requests a certificate for the new domain automatically.

Background apps, queues, and cron jobs

Manage your site's processes on its Processes tab (or the server's Daemons and Schedules tabs):

  • Proxy apps: created automatically when Run the app as a daemon is checked during site creation.
  • Queue workers: add a daemon such as php artisan queue:work.
  • Cron jobs: add a schedule such as * * * * * running php artisan schedule:run.

For any daemon you add manually, copy its restart line (sudo systemctl restart crabsmith-daemon-<id>) into Settings → Deployment so every deploy restarts it cleanly. PHP presets already end with sudo systemctl reload "$PHP_FPM".

Custom Caddy config

Crabsmith manages /etc/caddy/sites/site-<id>.caddy from your site settings—always make Caddy customizations through Settings → Caddy rather than editing that file directly over SSH:

  • Inside the site block: add headers, redirects, basic auth, rate limits, or caching. Your handle blocks run before the panel's; wrap rules in route { } if directive order matters.
  • Before / after the site block: add extra site blocks, such as redirecting an old domain or www here.

For example, to redirect www.example.com to example.com, add this Before the site block (make sure www.example.com has an A record pointing to your server):

caddyfile
www.example.com {
    redir https://example.com{uri} permanent
}

Caddy validates every save first. If there's a syntax error, the previous config stays live and your changes aren't applied.

For full manual control, choose Take over the whole file. While you own the file, domain/HTTPS/directory controls are locked until you choose Give it back to the panel.

Run commands on a site

Need to run a quick php artisan, php bin/console, wp, or npm command without opening a full terminal? Use the site's Commands tab—see Deploys.

Delete a site

Open Settings and click Delete site. This removes:

  • The site's Caddy config and deploy key
  • Daemons and schedules whose working directory is the site's folder
  • The site's folder (if Crabsmith created it)

Warning

Deleting a site removes its folder permanently. Check Keep files if you want to remove the site from Crabsmith and Caddy without deleting its files.