# Self-host Seafile

> Self-hosted file sync and share with real file-level versioning and client-side encryption options.

- Page: https://levelrail.com/templates/seafile/
- JSON: https://levelrail.com/templates/seafile.json
- Category: Storage
- Licence: AGPL-3.0-only (Network copyleft (AGPL) license)
- Source: https://github.com/haiwen/seafile-server
- Upstream docs: https://manual.seafile.com

## Requirements
- Memory: about 1 GiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 11

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| mariadb | mariadb | 11 | none | seafile_mariadb_data -> /var/lib/mysql |
| memcached | memcached | latest | none | none |
| seafile | seafileltd/seafile-mc | 13.0.28 | 80 | seafile_data -> /shared |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| mariadb | MYSQL_DATABASE | preset |
| mariadb | MYSQL_PASSWORD | generated |
| mariadb | MYSQL_ROOT_PASSWORD | generated |
| mariadb | MYSQL_USER | generated |
| seafile | CACHE_PROVIDER | preset |
| seafile | INIT_SEAFILE_ADMIN_EMAIL | preset |
| seafile | INIT_SEAFILE_ADMIN_PASSWORD | generated |
| seafile | INIT_SEAFILE_MYSQL_ROOT_PASSWORD | generated |
| seafile | JWT_PRIVATE_KEY | generated |
| seafile | MEMCACHED_HOST | preset |
| seafile | MEMCACHED_PORT | preset |
| seafile | SEAFILE_MYSQL_DB_CCNET_DB_NAME | preset |
| seafile | SEAFILE_MYSQL_DB_HOST | preset |
| seafile | SEAFILE_MYSQL_DB_PASSWORD | generated |
| seafile | SEAFILE_MYSQL_DB_PORT | preset |
| seafile | SEAFILE_MYSQL_DB_SEAFILE_DB_NAME | preset |
| seafile | SEAFILE_MYSQL_DB_SEAHUB_DB_NAME | preset |
| seafile | SEAFILE_MYSQL_DB_USER | generated |
| seafile | SEAFILE_SERVER_HOSTNAME | preset |
| seafile | SEAFILE_SERVER_PROTOCOL | preset |
| seafile | TIME_ZONE | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy seafile --name my-seafile
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/seafile/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy Seafile on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id seafile for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image mariadb:11, memcached:latest, seafileltd/seafile-mc:13.0.28 is what you deploy there.

Self-host Seafile, Seafile docker compose file, deploy Seafile on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
