# SSL Configuration

PanelAlpha platform can operate based either on a domain or an IP address. If you are using a domain, you can configure hosts to use the appropriate SSL certificate.

# Free Let's Encrypt certificate

Steps to install a free SSL certificate:

  • Log in to your server via SSH with root access

  • Make sure that your domain is correctly resolving DNS to your server's IP address

  • Make sure port 80 on your server is not blocked by a firewall

  • Temporarily turn off the PanelAlpha application

    docker compose -f /opt/panelalpha/app/docker-compose.yml down
    
  • Use certbot docker image to request free Let's Encrypt certificate for your server (remember to replace YOUR_DOMAIN with correct domain)

    docker run -it --rm --name certbot \
    -v "/etc/letsencrypt:/etc/letsencrypt" \
    -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
    -p 80:80 \
    certbot/certbot certonly --standalone \
    --cert-name panelalpha-app \
    -d YOUR_DOMAIN
    
  • Follow the instructions in the terminal (you need to enter your email address and accept "Terms of Service")

  • Use following commands to point the certificate files to PanelAlpha application

    sed -i~ '/^SSL_CERT_FULLCHAIN=/s#=.*#=/etc/letsencrypt/live/panelalpha-app/fullchain.pem#' /opt/panelalpha/app/.env
    
    sed -i~ '/^SSL_CERT_PRIVKEY=/s#=.*#=/etc/letsencrypt/live/panelalpha-app/privkey.pem#' /opt/panelalpha/app/.env
    
  • Turn PanelAlpha application on again

    docker compose -f /opt/panelalpha/app/docker-compose.yml up -d
    

# Custom certificate

  • Log in to your server via SSH as root

  • Make sure you know the full paths of your certificate files (full chain file and private key file)

  • Temporarily turn off PanelAlpha application

    docker compose -f /opt/panelalpha/app/docker-compose.yml down
    
  • Use following commands to point the certificate files to PanelAlpha application **(remember to replace /path/to/fullchain and /path/to/privatekey with correct paths)''

    sed -i~ '/^SSL_CERT_FULLCHAIN=/s#=.*#=/path/to/fullchain#' /opt/panelalpha/app/.env
    
    sed -i~ '/^SSL_CERT_PRIVKEY=/s#=.*#=/path/to/privatekey#' /opt/panelalpha/app/.env
    
  • Turn PanelAlpha application on again

    docker compose -f /opt/panelalpha/app/docker-compose.yml up -d
    

# Domain configuration in PanelAlpha

Update the 'Application URL' and the 'Admin URL' by using the Change Domain option as documented here.