We have two methods for have self-signed certs, ordered by complexity (easiest first)
Method
Description
Difficulty
Security
Method 1
Self-signed certs + skip verification
⭐⭐ Medium
Good
Method 2
Self-signed certs + full verification
⭐⭐⭐ Advanced
Best
check_circle
Recommended: Only use this guide if you have specific security requirements. Otherwise check the Traefik Setup Guide which covers full deployment of all the services, this is the most easy and recommended way.
Method 1: Self-Signed Certificates (Skip Verification) link
http:routers:onlyoffice:entrypoints:- websecure # or 'https' depending on your configrule:Host(`onlyoffice.yourdomain.com`)tls:certResolver:letsencrypt # Your cert resolver nameservice:onlyoffice# This is the critical setting:middlewares:- onlyoffice-headersservices:onlyoffice:loadBalancer:servers:- url:"https://onlyoffice"# Note: HTTPS, not HTTPserversTransport:onlyoffice # Reference to transport belowmiddlewares:onlyoffice-headers:headers:customRequestHeaders:X-Forwarded-Proto:"https"accessControlAllowOriginList:- "*"serversTransports:onlyoffice:insecureSkipVerify:true# This skips certificate verification
warning
Security Consideration:insecureSkipVerify: true means Traefik won’t validate OnlyOffice’s certificate. This is acceptable because:
Communication stays within Docker network
OnlyOffice is not directly exposed
Browser still sees valid Let’s Encrypt certificate
[req]default_bits=2048prompt=nodefault_md=sha256distinguished_name=dnx509_extensions=v3_req[dn]CN=onlyoffice[v3_req]subjectAltName=@alt_names[alt_names]IP.1=172.18.0.255 # Static IP for OnlyOffice containerDNS.1=onlyoffice # Docker service name
info
Why IP and DNS?
IP.1: Allows verification via IP address
DNS.1: Allows verification via Docker service name
Both are required for proper certificate validation
services:onlyoffice:image:onlyoffice/documentservercontainer_name:onlyofficeenvironment:- JWT_ENABLED=true- JWT_SECRET=your-secret- ONLYOFFICE_HTTPS_HSTS_ENABLED=falsevolumes:- ./certs:/var/www/onlyoffice/Data/certsnetworks:proxy_network:ipv4_address:172.18.0.255# Must match cert.conf
warning
IP Address Rules:
Must be in your Docker network subnet (e.g., 172.18.0.0/24)
Use high numbers (>100) to avoid Docker’s auto-allocation range
http:routers:onlyoffice:entrypoints:- websecurerule:Host(`office.yourdomain.com`)tls:certResolver:letsencryptservice:onlyofficeservices:onlyoffice:loadBalancer:servers:- url:"https://onlyoffice"# Or https://172.18.0.255serversTransport:onlyofficemiddlewares:onlyoffice-headers:headers:customRequestHeaders:X-Forwarded-Proto:"https"accessControlAllowOriginList:- "*"serversTransports:onlyoffice:rootCAs:- /certs/onlyoffice.crt # Path inside Traefik container# insecureSkipVerify NOT set (defaults to false)
check_circle
Security Improvement: Now Traefik fully validates OnlyOffice’s certificate using the provided CA, ensuring encrypted and authenticated communication.
# Check Traefik logsdocker logs traefik | grep -i certificate
# Common errors:# - "x509: certificate signed by unknown authority" → Need rootCAs in transport# - "x509: certificate is valid for X, not Y" → DNS/IP mismatch in cert# - "tls: bad certificate" → Wrong certificate mounted
server:externalUrl:"https://files.yourdomain.com"integrations:office:url:"https://onlyoffice.yourdomain.com"internalUrl:"https://onlyoffice:80"# Method 1/2 only
# OnlyOffice: HTTPS with SAN certnetworks:proxy_network:ipv4_address:172.18.0.255# Traefik: Verify with CAserversTransports:onlyoffice:rootCAs:- /certs/onlyoffice.crt