SSL Setup for Self-Hosted Spwig Store with Let's Encrypt

Here’s how I set up SSL for my self-hosted Spwig store using Let’s Encrypt and Nginx. I run Spwig on a Hetzner VPS with Docker Compose, and this setup ensures secure HTTPS access for my partner’s jewelry shop.

Step 1: Configure Domain & SSL in Spwig Admin
Go to Settings > Site Settings > Domain & SSL. Enter your domain name and select Let’s Encrypt as the SSL mode. Enter your admin email address for certificate expiry notifications. Click Apply Configuration — Spwig will handle the rest automatically.

Step 2: Verify DNS and Port 80 Access
Make sure your domain’s A record points to your server’s IP address. Also, ensure port 80 is open on your firewall — this is needed for Let’s Encrypt to verify your domain.

Step 3: Configure Nginx to Enforce HTTPS
In your Nginx config (usually located in /etc/nginx/sites-available/), add the following to redirect HTTP traffic to HTTPS:

server {
    listen 80;
    server_name yourdomain.com;

    location / {
        return 301 https://$host$request_uri;
    }
}

Reload Nginx with nginx -t && systemctl reload nginx to apply the changes.

Step 4: Automate Certificate Renewal
Let’s Encrypt certificates renew automatically every 60-90 days. I set up a cron job to run certbot renew --dry-run weekly to test the renewal process. This ensures I don’t get caught off guard if something goes wrong.

One thing to watch out for: always test your SSL setup after making changes. Use tools like SSL Labs’ SSL Test to verify everything is working correctly.

2 Likes

Thanks for the detailed setup, Tom!

I’ve deployed Spwig on a few VPS instances and always use Let’s Encrypt with Nginx. One thing I’ve found helpful is adding the --non-interactive flag to the certbot renew command in the cron job to avoid prompts during automated renewals. It keeps things clean if you’re running it in a headless environment.

Also, for the Nginx config, I’ve been using return 307 instead of 301 for the redirect — it preserves the original HTTP method, which is slightly safer for POST requests. YMMV, but it’s been working well for me.

Thanks for sharing, Tom! I remember when I was on WooCommerce, setting up SSL felt like a maze — let alone getting Nginx to play nicely. Your step-by-step is a breath of fresh air. I migrated to Spwig a few months ago, and while the SSL setup was smoother, I still had to wrestle with DNS and ports for a while. Your tip about testing with SSL Labs is something I wish I’d known earlier. Definitely going to try that cron job for renewal checks. Cheers!