Self-host Seafile

Self-hosted file sync and sharing server with desktop and mobile clients, libraries that can be encrypted, and an optional online document editor (SeaDoc). Run your own Seafile on an always-on EnvHaven workspace by asking its coding agent: one request installs it, puts it on an HTTPS address and locks it down. What the agent takes care of, and the manual route.

Updated November 23, 2026

Running your own Seafile usually means a list of server chores: a machine that stays on, Docker or a runtime, a reverse proxy with certificates, a domain, and the settings that make Seafile behave behind all of it. On an EnvHaven workspace you skip the list. You ask the coding agent, and it does the work while you watch.

Just ask your agent

Open a Plus workspace (Seafile runs in Docker, which Plus and Pro include), tap Launch to start any coding agent (Claude Code, Codex, OpenCode or another), and ask it:

Set up Seafile on this workspace and give me the link. Follow https://envhaven.com/self-host/seafile.md

Then open the link it sends and create your Seafile account straight away, before anyone else finds the address. That is the whole request: the address in it is this page’s Markdown copy, and the agent follows the instructions for it further down, with every setting Seafile’s docs require.

Or keep it private with Tailscale

The preview URL puts Seafile on the public internet, which suits something other people need to reach. For an app only you and your household use, your tailnet is the better home: Tailscale gives Seafile an HTTPS address that only your own devices, signed in to your Tailscale account, can open. Save a Tailscale auth key in the workspace’s Vars pane as TS_AUTHKEY, and ask the agent:

Set up Seafile on my tailnet instead of the preview URL. Follow https://envhaven.com/self-host/seafile.md and https://envhaven.com/guides/self-host-privately-with-tailscale.md
  • A Tailscale container runs beside Seafile, so it keeps its private address through workspace restarts and updates, and every app you set up this way gets an address of its own.
  • Anything other services have to reach, such as a webhook, still needs a public address. Keep self-hosted apps private with Tailscale covers both, and what Tailscale’s free plan includes.
At a glance
What it isFiles, photos and documents
LicenseMixed by component: Seafile Server core AGPLv3
Runs asDocker (seafileltd/seafile-mc:13.0-latest)
Memory2 GB for Seafile CE (the Docker stack includes MariaDB, Redis, SeaDoc and Caddy) (docs)
Plan that fitsPlus or larger
Web port80
Documentationmanual.seafile.com/latest/setup/setup_ce_by_docker/

What your agent takes care of

  • Installing it. Seafile runs from the official image, seafileltd/seafile-mc:13.0-latest, with its data in folders under ~/apps/seafile.
  • Putting it on an HTTPS address. The workspace’s preview URL serves it, and your own domain can too.
  • Locking it down first. What Seafile’s docs say to set before it faces the internet, below.
  • Telling you what to back up: /opt/seafile-data (mounted as /shared in the container): Seafile configuration, library data and logs, /opt/seafile-mysql/db: the MariaDB databases ccnet_db, seafile_db and seahub_db and /opt/seafile-caddy: Caddy data with Let’s Encrypt certificates (docs).

The settings it needs behind a proxy

  • SEAFILE_SERVER_HOSTNAME: Environment variable in .env: Seafile server hostname or domain (required); with the protocol it determines the service URL. (docs)
  • SEAFILE_SERVER_PROTOCOL: Environment variable in .env: http or https (default http); set it to https when the public address is https. (docs)
  • ALLOWED_HOSTS: seahub_settings.py: host and domain names Seahub accepts, for example [‘.example.com’]. (docs)
  • CSRF_TRUSTED_ORIGINS: seahub_settings.py: trusted origins for CSRF checks, written with the scheme, for example https://www.myseafile.com. (docs)
  • CSRF_COOKIE_SECURE: seahub_settings.py: whether the CSRF cookie is marked secure (shown as True in the docs’ example); CSRF_COOKIE_SAMESITE is shown as Strict. (docs)
  • Upgrade: A reverse proxy in front of Seafile has to pass WebSocket upgrades for SeaDoc (/socket.io) and the notification server; the docs’ nginx example sets Upgrade and Connection there. (docs)
  • client_max_body_size: The docs’ nginx example for the seafile location sets client_max_body_size 0, together with proxy_buffering off and proxy_request_buffering off. (docs)

Before it faces the internet

  • The initial admin is [email protected] with password asecret unless changed; the docs recommend changing both in .env before the first start. (docs)
  • JWT_PRIVATE_KEY is required and has to be a random string of at least 32 characters. (docs)
  • Database passwords are required: the MySQL root password on first deployment and the seafile user password. (docs)

Things to ask next

Everything after the install is one more sentence to the agent. Some that come up:

  • “Import the files in ~/artifacts, keeping their folders.”
  • “Check how much disk it uses, and warn me when the workspace passes 80 percent.”
  • “Move Seafile to app.example.com.” Add the domain on the dashboard’s Domains page with a CNAME to domains.envhaven.app, and the agent changes Seafile’s address settings to match.
  • “Update Seafile to the latest release.” It pulls the new image and recreates the container, data kept.

Instructions for the agent

The agent reads these from the page’s Markdown copy. They also work pasted on their own, if you would rather give them in your own words.

Set up Seafile on this workspace and serve it at my preview URL.
- Use Docker Compose with the official image, seafileltd/seafile-mc:13.0-latest, starting from the docs' compose file: https://manual.seafile.com/13.0/repo/docker/ce/seafile-server.yml. If `docker compose` is missing, install the Compose plugin into ~/.docker/cli-plugins first.
- The docs' setup includes: db (MariaDB 10.11); redis; caddy (caddy-docker-proxy on ports 80 and 443, mounts the Docker socket); SeaDoc server (seadoc.yml, on by default through ENABLE_SEADOC).
- Keep the compose file in ~/apps/seafile and all of its data in folders there (bind mounts, not named volumes), with restart: unless-stopped on every service.
- This server has no firewall, so publish no port on its public IP, and drop host networking and privileged mode from the docs' compose file. Docker runs on the host: connect this workspace to the compose network and relay my preview URL's port to Seafile's port 80.
- The preview URL terminates HTTPS in front of Seafile: serve plain HTTP on its port, and trust the forwarded headers the relay passes on.
- Set what "The settings it needs behind a proxy" lists on https://envhaven.com/self-host/seafile.md for the preview URL, as Seafile's docs describe for running behind a proxy; skip any that apply only when Seafile serves HTTPS itself.
- Before the preview URL serves it, apply what "Before it faces the internet" lists on https://envhaven.com/self-host/seafile.md.
- When it answers at the preview URL, send me the link and tell me what to back up.
- If I asked for my tailnet instead of the preview URL, set Seafile up the same way but follow https://envhaven.com/guides/self-host-privately-with-tailscale.md for the network: no preview URL, no relay.

What to know

  • In Docker, Seafile’s containers keep running when the workspace restarts or updates. The relay from the preview URL is a process in the workspace, so after a restart or an update, ask the agent to restore it.
  • The file server’s maximum upload size (seafile.conf, [fileserver] max_upload_size, in MB) has no limit unless it is configured; the docs’ example sets 200. (docs)
  • The bundled Caddy container mounts the Docker socket and publishes ports 80 and 443. (docs)
  • The docs do not mention Cloudflare or chunked uploads through a proxy: searches of the docs repo for cloudflare matched only the site build file, and chunk matched only unrelated pages. Only the nginx example’s client_max_body_size 0 is documented for upload size at the proxy. (docs)
  • Email (password resets, share links, notifications) is sent through an SMTP server configured in seahub_settings.py. (docs)
  • Community Edition has no binary install since 13.0. (docs)
  • A workspace has one preview URL and one custom domain, both serving the same port, so it puts one app on a public address at a time.

Without a workspace

The manual route, on a server you run:

  1. Rent a Linux VPS, secure SSH, and create a user for the app.
  2. Install Docker and write a compose file from the official image.
  3. Put a reverse proxy in front (Caddy, nginx or Traefik), get certificates, and point a domain at the server.
  4. Set the proxy settings listed above for that domain, and pass WebSocket upgrades through the proxy if the app uses them.
  5. Keep the firewall closed except for the proxy, and schedule backups and updates.

Seafile’s own documentation covers each step for its install methods.

Sources

Facts about Seafile come from its own documentation, checked on 2026-11-23: