Put ownCloud on HTTPS with Let’s Encrypt and Nginx

Terminate TLS at a reverse proxy in front of ownCloud Server, then use Certbot to obtain and renew a Let’s Encrypt certificate. For one public hostname, Nginx with the HTTP-01 challenge is usually the simplest route when the proxy can accept inbound connections on port 80. If port 80 cannot be exposed, or you need a wildcard certificate, use DNS-01 with an automated DNS integration instead.

This article targets ownCloud Classic Server 11 in Docker with Nginx on the same Linux host. Current ownCloud documentation directs TLS to a proxy. These interface-style examples use a placeholder hostname; substitute yours.

Choose the certificate method that fits your network

If you already run a TLS-terminating proxy, keep certificate management there instead of adding another proxy. Certbot’s Nginx plugin obtains the certificate and edits the virtual host, but changes your Nginx configuration. If you prefer to manage that configuration yourself, use Certbot’s certificate-only mode and wire the certificate paths into your proxy manually.

ChoiceBest fitMain tradeoff
HTTP-01 with Nginx and CertbotA public single hostname with inbound TCP 80 availableSimple, no DNS API secret; depends on correct public DNS and port 80 reachability. It cannot issue wildcard certificates.
DNS-01 with a DNS provider pluginPort 80 is closed, the service is private, or you need a wildcardWorks without a public web challenge, but automated renewal needs DNS API access. Use a narrowly scoped credential and protect it.
Existing proxy’s ACME integrationA proxy already manages certificates for other sitesFewer moving parts; renewal behavior and configuration are specific to that proxy.

Let’s Encrypt’s optional tlsserver profile began issuing 45-day certificates on May 13, 2026; its default classic certificates remain 90 days until switching to 64 days on February 10, 2027. Certbot often schedules renewal; verify yours.

A DNS management window lists cloud.example.com with a sample A-record address and shows inbound TCP ports 80 and 443 as allowed.
Example DNS and firewall panels for cloud.example.com. Replace the sample address with the server’s public IP and allow inbound TCP 80 and 443.

Configure ownCloud and Nginx for a public hostname

  1. Point DNS to the proxy and open the required ports. Create an A record for cloud.example.com that points to the server’s public IPv4 address. Add an AAAA record only if IPv6 reaches the same proxy correctly. Allow inbound TCP 80 for HTTP-01 validation and TCP 443 for users’ HTTPS connections in both the host firewall and any cloud firewall or router. Check DNS from outside your network.
  2. Set ownCloud’s external URL and restrict the app port. In the existing Compose .env file, replace the example hostname and set the relevant values:
OWNCLOUD_DOMAIN=cloud.example.com
OWNCLOUD_TRUSTED_DOMAINS=cloud.example.com
OWNCLOUD_OVERWRITE_CLI_URL=https://cloud.example.com
OWNCLOUD_OVERWRITE_HOST=cloud.example.com
OWNCLOUD_OVERWRITE_PROTOCOL=https
OWNCLOUD_TRUSTED_PROXIES=PROXY_SOURCE_IP
HTTP_PORT=127.0.0.1:8080

PROXY_SOURCE_IP is a placeholder: use the address ownCloud actually sees for the proxy, not an assumed loopback address. Docker networking changes the source address ownCloud sees. Trust only the proxy address or smallest required set; broad trust lets clients spoof forwarded information. The official Compose example publishes ownCloud on port 8080; binding the host side to loopback keeps the app’s HTTP listener off the public interface when the provided port mapping uses ${HTTP_PORT}:8080. If your Nginx is in a container, use a private shared Docker network and its service address instead of this host-loopback example.

Keep your existing database, Redis, and volume settings. After editing the file, recreate the ownCloud service so it reads the updated environment: docker compose up -d owncloud.

A terminal window shows the Certbot Nginx command for cloud.example.com and the resulting fullchain.pem and privkey.pem paths.
Sample Certbot output showing a certificate request for cloud.example.com and the certificate and private-key file paths.
  1. Add an HTTP virtual host that proxies to ownCloud. Create or update the Nginx site for the hostname. This starter block lets Nginx serve the app over HTTP while Certbot validates the domain:
server {
    listen 80;
    server_name cloud.example.com;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Enable the site using your distribution’s Nginx layout, then check and reload Nginx with sudo nginx -t and sudo systemctl reload nginx. Site-enablement paths vary by distribution. Keep the ACME HTTP challenge reachable; do not put an authentication gate or a blanket redirect rule in front of the challenge path while issuing the certificate.

An Nginx configuration window shows TLS certificate paths and proxy_pass to 127.0.0.1:8080 with X-Forwarded-Proto set to https.
The HTTPS virtual host sends requests from Nginx to the ownCloud service on the host’s loopback address.
  1. Issue the certificate and enable the redirect. Install Certbot using the instructions for your Linux distribution and Nginx plugin, then run:
sudo certbot --nginx -d cloud.example.com --redirect

Certbot’s Nginx installer obtains the certificate and configures HTTPS and an HTTP-to-HTTPS redirect. Review the Nginx changes before accepting them. If you want Certbot to issue the certificate without editing Nginx, use sudo certbot certonly --nginx -d cloud.example.com, then manually configure the TLS virtual host with the resulting fullchain.pem and privkey.pem paths and reload Nginx. Never publish or paste the private-key file.

Check HTTPS and unattended renewal

Open https://cloud.example.com from an external network. Confirm the browser reports a valid certificate, ownCloud loads without a redirect loop, and generated links use HTTPS. If ownCloud reports an untrusted domain or builds HTTP links, check OWNCLOUD_TRUSTED_DOMAINS, OWNCLOUD_OVERWRITE_HOST, OWNCLOUD_OVERWRITE_PROTOCOL, and the trusted proxy address.

  1. Test renewal and confirm the schedule. Run Certbot’s non-production renewal test:
sudo certbot renew --dry-run
sudo systemctl list-timers --all | grep -i certbot

A successful dry run checks the renewal path without replacing the live certificate. The Nginx installer should deploy renewed certificates through its renewal integration; if you use certificate-only or webroot mode instead, make sure your renewal setup reloads Nginx after a successful renewal. Certbot documents deployment hooks for renewal for that purpose. Check the scheduler again after installation or migration, and alert on renewal failures rather than relying on a person to renew by hand.

For DNS-01, use the plugin documented for your DNS provider, create an API token limited to the records it must change, and test automatic renewal with the same Certbot dry run. Let’s Encrypt notes that DNS-01 supports wildcard names and services that are not public, but warns that broad DNS credentials on the web server increase the impact of a compromise.

For the version-specific details, see the ownCloud Server 11 Docker installation guide, its reverse proxy configuration and environment variable reference. For validation and renewal choices, consult Let’s Encrypt’s challenge documentation, its certificate lifetime schedule, and the Certbot instructions for your operating system.

A browser shows https://cloud.example.com with a lock icon above an ownCloud sign-in screen, with a terminal renewal dry-run below.
Example verification view: the browser uses HTTPS and Certbot’s renewal dry run reports success. This is an illustrative expected result, not a test of your server.

Leave a Comment

Put ownCloud on HTTPS with Let’s Encrypt and Nginx

Put ownCloud on HTTPS with Let’s Encrypt and Nginx

Choose HTTP-01 or DNS-01, configure an ownCloud reverse proxy, and verify Certbot renews HTTPS certificates automatically.

Connect ownCloud Infinite Scale to LDAP for User Sign-In

Configure oCIS LDAP sign-in, align user and group lookups, and verify TLS and schema settings before rollout.

Connect an S3 Bucket to ownCloud 10 as External Storage

Connect an S3 Bucket to ownCloud 10 as External Storage

Add an Amazon S3 bucket to ownCloud 10, prepare compatible credentials and endpoints, and check access without confusing a mount with primary storage.

Automate ownCloud Database Dumps with a Safe Nightly Cron Job

Automate ownCloud Database Dumps with a Safe Nightly Cron Job

Schedule protected MariaDB dumps for ownCloud Server, handle maintenance mode safely, and verify each backup before relying on it.

Move ownCloud Classic to oCIS with a Supported Migration

Plan an ownCloud 10 to oCIS migration with the supported app, ordered commands, identity checks, and a clear list of data that needs separate handling.

Brand ownCloud Classic 10 with a Theme App and CSS

Replace ownCloud Classic 10 logos and tune web UI colors with a theme app, while avoiding upgrade and integrity-check pitfalls.

Set Default Storage Quotas by User Role in ownCloud oCIS

Set Default Storage Quotas by User Role in ownCloud oCIS

Assign byte-based storage limits to new ownCloud Infinite Scale users by role, with a proxy.yaml example and a safe verification checklist.

Fix ownCloud Sync Certificate Errors at the TLS Source

Fix ownCloud Sync Certificate Errors at the TLS Source

Restore ownCloud desktop syncing by checking the server hostname, certificate chain, private CA trust, and captive portal issues without disabling TLS verification.

Clear an ownCloud Integrity Warning After an Upgrade

Use the invalid-file report to identify mismatched core files or app signatures, restore the correct release files, and verify the integrity check safely.

Install ownCloud Infinite Scale with Docker Compose

Deploy ownCloud Infinite Scale from its official Compose example, configure domains and persistent storage, then verify TLS, containers, and first login.