# Guide for installing the latest version of Seafile on Unraid with online connection through Cloudflare Tunnel or Nginx Proxy manager

**URL:** <https://forum.hhf.technology/t/guide-for-installing-the-latest-version-of-seafile-on-unraid-with-online-connection-through-cloudflare-tunnel-or-nginx-proxy-manager/268>\
**Category:** Self-hosted Applications\
**Tags:** unraid, cloudflare-tunnels, nginx-proxy-manager, seafile\
**Created:** [October 20, 2024, 6:51am UTC](https://forum.hhf.technology/t/guide-for-installing-the-latest-version-of-seafile-on-unraid-with-online-connection-through-cloudflare-tunnel-or-nginx-proxy-manager/268 "2024-10-20T06:51:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [October 20, 2024, 6:51am UTC](https://forum.hhf.technology/t/guide-for-installing-the-latest-version-of-seafile-on-unraid-with-online-connection-through-cloudflare-tunnel-or-nginx-proxy-manager/268/1 "2024-10-20T06:51:38Z")

</div>

This guide outlines the process for installing Seafile, MariaDB, and connecting it online using Cloudflare Tunnel with your custom hostname or use it with Nginx Proxy Manager

**Preparation Steps:**

- Replace `seafile.example.tld` with your actual hostname. You can check available domains at Cloudflare.

**Docker Configuration:**

1. Navigate to **Unraid Settings → Docker**.
2. Set **Enable Docker** to **No** and click **Apply**.
3. Change **Preserve user defined networks** to **Yes**.
4. Set **Enable Docker** to **Yes** and click **Apply** again.
5. Open the terminal (click the \>\_ icon).
6. Create a Docker network:

```bash
docker network create seafile-net

```

7. Verify the network creation:

```bash
docker network list

```

8. Close the terminal.

**Installing MariaDB:**

1. Install MariaDB from the Linuxserver repository.
2. On the configuration screen, modify the following:
  - **Name:** seafile-mariadb
  - **Network Type:** seafile-net
  - **MYSQL\_ROOT\_PASSWORD:** (choose a password and note it for later)
  - **MYSQL\_USER:** (choose a username)
  - **MYSQL\_PASSWORD:** (choose a password)

3. Apply settings and install.

**Installing Seafile:**

1. Install Seafile from dglb99’s repository.
2. On the configuration screen, adjust:
  - **Repository:** seafileltd/seafile-mc:11.0-latest
  - **Network Type:** seafile-net
  - **Seafile Hostname:** seafile.example.tld
  - **SQL Root Password:** (the password noted earlier)
  - **Admin Email:** (use a real email for recovery)
  - **Admin Password:** (choose a password)

3. Apply settings and install.

Your Seafile server should now be accessible within your private network. To make it available online, consider these options:

- **VPN Hosting:** This allows remote access but may complicate multiple user access for Seafile. Configure this via Unraid Settings → VPN Manager.
- **NGINX Proxy Manager:** A viable solution, though it may require additional configuration.
- **Cloudflare Tunnel:** This is straightforward to set up. Refer to Spaceinvaderone’s video tutorial; if you purchased your domain through Cloudflare, skip to 3:36 in the video for tunnel connection instructions.

After completing these steps, your server should be online!

### Troubleshooting Common Issues:

1. **“File Upload Failed”:**

2. **“CSRF Verification Failed”:**

 ![image](https://forum-cdn.hhf.technology/original/1X/6fcf79376921e9ca55926e8ac97a8c38b8e6dbbf.jpeg)

“Failed to download. The total size of the files exceeded the limit.”

- Open seafile.conf ( \SERVER\seafile\seafile\conf ) and add `max_download_dir_size=10000` and `max_upload_size=10000` under `[fileserver]`. Change the value to whatever you want your upper limit to be, in this example it’s set to 10,000MB. Save the file and restart the server to see changes.

, for anyone having problems running it locally, you might want change these IPs and ports in Seafile System Admin Settings. After this works, try enabling https for better security.

# Note that port 8080 is the default port used in the Unraid template and the IP I used here is the IP address of my Unraid server Seafile is running on.

Please change it

- **SERVICE\_URL** : [[http://192.168.1.120:8082](http://192.168.1.120:8082)]([http://192.168.1.120](http://192.168.1.120) :8082/)
- **FILE\_SERVER\_ROOT** : [http://192.168.1.120:8082/seafhttp](http://192.168.1.120:8082/seafhttp)

# Now fire up nginx-proxy-manager

- Login into nginx-proxy-manager
- Add new proxy host (seafile.example.tld as specified in seafile-docker-compose.yml/ unraid sefile app)
- Use HTTP (not HTTPS) to HOST IP, Port 8180 (as specified in seafile-docker-compose.yml)
- Turn on SSL options and force SSL
- Add custom nginx configuration within Advanced

```auto
proxy_read_timeout 310s;
proxy_set_header Host $host;
proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection "";
proxy_http_version 1.1;

client_max_body_size 0;

```

## Test connection

- Login to Seafile should work now
- Upload/Download will not work

## Adjust config files in Seafile container

- cd to seafile-data/seafile/conf/
- edit seahub\_settings.py
- Change SERVICE\_URL and FILE\_SERVER\_ROOT to use “https://” instead of “http://”

You have to define a “custom location” for your entry in Nginx Proxy Manager that points to FILE\_SERVER port (default 8082) and has config below:

```nginx
rewrite ^/seafhttp(.*)$ $1 break;
client_max_body_size 0;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 36000s;
proxy_read_timeout 36000s;
proxy_request_buffering off;

```

 ![image](https://forum-cdn.hhf.technology/original/1X/0c4e88b8829a39eec787bf2eb3fcc23ee363bb23.png)
