Configuration
This guide covers the configuration options for SilkPanel SaaS, including domain setup with or without Cloudflare.
Domain Configuration
There are two common scenarios for setting up your domain with SilkPanel running on a Windows Server with Laragon:
Option 1: Using Cloudflare (Recommended)
Many users prefer using Cloudflare as it provides additional security, caching, and DDoS protection for your application.
Benefits of Using Cloudflare
- DDoS Protection: Automatically protects your server from distributed denial-of-service attacks
- SSL/TLS Encryption: Free SSL certificates with flexible encryption modes
- Caching: Speeds up your website by caching static assets globally
- Analytics: Built-in analytics and traffic insights
- DNS Management: Easy-to-use DNS interface
Setup Steps with Cloudflare
Add Your Domain to Cloudflare
- Sign up or log in to Cloudflare
- Click "Add a Site" and enter your domain name
- Select your plan (Free plan is sufficient for most users)
Update Your Nameservers
- Cloudflare will provide you with two nameservers
- Go to your domain registrar's control panel
- Replace the existing nameservers with Cloudflare's nameservers
- Wait for DNS propagation (can take up to 24 hours)
Configure DNS Records
In Cloudflare's DNS settings, add an A record:
- Type: A
- Name: @ (for root domain) or subdomain name
- IPv4 address: Your Windows server's public IP address
- Proxy status: Proxied (orange cloud) for protection
- TTL: Auto
If you want to use www subdomain, add another A record:
- Type: A
- Name: www
- IPv4 address: Your Windows server's public IP address
- Proxy status: Proxied (orange cloud)
Configure SSL/TLS Settings
- Go to SSL/TLS in Cloudflare dashboard
- Set encryption mode to Full or Full (strict)
- Enable Always Use HTTPS
- Enable Automatic HTTPS Rewrites
Configure Your Application
- Update your
.envfile:
mdAPP_URL=https://yourdomain.com- Update your
TIP
When using Cloudflare's proxy (orange cloud), your server will receive requests from Cloudflare's IP addresses. To get the real visitor IP, enable Cloudflare's IP Geolocation feature or use the CF-Connecting-IP header.
Option 2: Direct Domain Linking (Without Cloudflare)
Some users prefer to link their domain directly to their Windows Server where Laragon is installed, without any intermediary service.
When to Choose Direct Linking
- You want complete control over your DNS configuration
- You have your own security measures in place
- You want to minimize latency by removing the proxy layer
- Your hosting provider offers adequate DDoS protection
Setup Steps for Direct Linking
Obtain Your Server's Public IP Address
- On your Windows Server, open Command Prompt
- Run:
ipconfigto find your local IP - If behind a router, you need your public IP address
- You can check your public IP at https://whatismyipaddress.com
Configure Port Forwarding (If Using a Router)
- Log in to your router's admin panel
- Set up port forwarding rules:
- Port 80 (HTTP) → Your server's local IP
- Port 443 (HTTPS) → Your server's local IP
- Save the configuration
Configure DNS Records at Your Domain Registrar
- Log in to your domain registrar's control panel
- Navigate to DNS management/DNS settings
- Add the following DNS records:
For root domain:
- Type: A
- Host: @ (or leave empty)
- Points to: Your server's public IP address
- TTL: 3600 (or default)
For www subdomain:
- Type: A or CNAME
- Host: www
- Points to: Your server's public IP address (A) or yourdomain.com (CNAME)
- TTL: 3600
Configure Windows Firewall
- Open Windows Defender Firewall with Advanced Security
- Create inbound rules for:
- Port 80 (HTTP)
- Port 443 (HTTPS)
- Allow connections from any IP address
Set Up SSL Certificate
- Since you're not using Cloudflare, you need to configure SSL on your server
- Options include:
- Let's Encrypt: Free SSL certificates (recommended)
- Commercial SSL: Purchase from providers like DigiCert, Sectigo
- Use Certbot or similar tools to automate Let's Encrypt certificates
Configure Laragon and Apache/Nginx
- In Laragon, add a virtual host for your domain
- Right-click Laragon → Apache → sites-available → Add new virtual host
- Point it to your project's
publicfolder - Restart Apache/Nginx
Update Application Configuration
- Update your
.envfile:
mdAPP_URL=https://yourdomain.com- Update your
WARNING
When using direct domain linking, ensure your server has proper security measures:
- Keep Windows Server and all software up to date
- Configure a firewall to block unwanted traffic
- Use strong passwords and consider SSH key authentication
- Regularly backup your data
- Monitor server logs for suspicious activity
Environment Configuration
After setting up your domain, configure the following in your .env file:
# Application
APP_NAME="SilkPanel"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com
# Database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_database_user
DB_PASSWORD=your_database_password
# Mail Configuration
MAIL_MAILER=smtp
MAIL_HOST=your_mail_host
MAIL_PORT=587
MAIL_USERNAME=your_mail_username
MAIL_PASSWORD=your_mail_password
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME="${APP_NAME}"Important
Always set APP_DEBUG=false in production environments to prevent sensitive information from being exposed.
Caching Configuration
For optimal performance, configure caching:
php artisan optimizeTo clear cache when needed:
php artisan optimize:clear