SSL/TLS Configuration
Secure your Trexzactyl installation with SSL/TLS certificates using Let's Encrypt.
Automatic SSL Setup
The installer includes automatic SSL certificate generation using Certbot and Let's Encrypt.
Prerequisites
Before setting up SSL:
- Domain Name: You need a valid domain name
- DNS Configuration: Domain must point to your server's IP address
- Ports Open: Ports 80 and 443 must be accessible
- Valid Email: Required for Let's Encrypt notifications
Installation with SSL
When running the installer:
bash <(curl -s http://installer.trexz.xyz/install.sh)
Select 1. Install Panel and follow the prompts:
- Enter your domain name (e.g.,
panel.example.com) - Enter your email address
- The installer will automatically:
- Install Certbot
- Generate SSL certificate
- Configure Nginx with SSL
- Set up auto-renewal
Manual SSL Setup
If you need to set up SSL manually:
Install Certbot
sudo apt update
sudo apt install -y certbot python3-certbot-nginx
Generate Certificate
sudo certbot --nginx -d panel.example.com
Follow the prompts to:
- Enter your email address
- Agree to terms of service
- Choose whether to redirect HTTP to HTTPS (recommended: yes)
Certificate Renewal
Let's Encrypt certificates expire after 90 days.
Automatic Renewal
Certbot automatically sets up a renewal timer:
sudo systemctl status certbot.timer
Manual Renewal
Test renewal:
sudo certbot renew --dry-run
Force renewal:
sudo certbot renew --force-renewal
Renewal Hooks
The installer configures automatic service reload after renewal:
sudo certbot renew --deploy-hook "systemctl reload nginx"
Nginx SSL Configuration
The installer creates an optimized SSL configuration:
server {
listen 443 ssl http2;
server_name panel.example.com;
ssl_certificate /etc/letsencrypt/live/panel.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/panel.example.com/privkey.pem;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256";
ssl_prefer_server_ciphers on;
# ... rest of configuration
}
Wildcard Certificates
For multiple subdomains, use a wildcard certificate:
sudo certbot certonly --manual --preferred-challenges dns -d "*.example.com" -d example.com
You'll need to add DNS TXT records as instructed.
Custom SSL Certificates
If you have your own SSL certificate:
Install Certificate
- Copy certificate files to the server:
/etc/ssl/certs/your-cert.crt
/etc/ssl/private/your-key.key
- Update Nginx configuration:
ssl_certificate /etc/ssl/certs/your-cert.crt;
ssl_certificate_key /etc/ssl/private/your-key.key;
- Reload Nginx:
sudo systemctl reload nginx
Cloudflare SSL
If using Cloudflare:
Full (Strict) Mode
- Generate Origin Certificate in Cloudflare dashboard
- Install certificate on server
- Set SSL mode to "Full (Strict)" in Cloudflare
Configuration
# Add Cloudflare real IP
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
real_ip_header CF-Connecting-IP;
SSL Testing
Test your SSL configuration:
Online Tools
Command Line
openssl s_client -connect panel.example.com:443 -servername panel.example.com
Troubleshooting
Certificate Generation Failed
- Verify DNS is pointing to server:
nslookup panel.example.com
- Check firewall:
sudo ufw status
- Verify ports are open:
sudo netstat -tlnp | grep -E ':(80|443)'
Rate Limits
Let's Encrypt has rate limits:
- 50 certificates per domain per week
- 5 duplicate certificates per week
If you hit the limit, wait or use staging environment for testing:
sudo certbot --staging --nginx -d panel.example.com
Certificate Not Trusted
Ensure you're using the fullchain certificate:
ssl_certificate /etc/letsencrypt/live/panel.example.com/fullchain.pem;
Not just the certificate:
# Wrong - don't use this
ssl_certificate /etc/letsencrypt/live/panel.example.com/cert.pem;
Security Best Practices
- Use Strong Ciphers: Modern TLS 1.2+ only
- Enable HSTS: Force HTTPS
- Disable Old Protocols: No SSLv3, TLS 1.0, TLS 1.1
- Regular Updates: Keep Certbot updated
- Monitor Expiry: Set up alerts for certificate expiration
HSTS Configuration
Add to Nginx configuration:
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
Certificate Locations
Important file locations:
- Certificates:
/etc/letsencrypt/live/your-domain/ - Renewal configs:
/etc/letsencrypt/renewal/ - Logs:
/var/log/letsencrypt/
