Introduction
Seafile is a powerful open-source cloud storage solution that allows you to host your own file sharing service. In this guide, we will walk you through the steps to install Seafile on Debian 12.
Prerequisites
- A server running Debian 12.
- Root access or a user with
sudo
privileges. - Basic knowledge of the command line.
Step 1: Update the System
Make sure your system is up to date. Run the following commands:
sudo apt update && sudo apt upgrade -y
Step 2: Install Required Dependencies
Install the required packages for Seafile:
sudo apt install -y python3 python3-pip python3-venv libmysqlclient-dev libssl-dev gcc
Step 3: Install and Configure MySQL
Seafile requires a database to function. We will use MySQL. Install the MySQL server:
sudo apt install -y mysql-server
Secure your MySQL installation:
sudo mysql_secure_installation
Log in to MySQL:
sudo mysql -u root -p
Once logged in, create a database and a user for Seafile:
CREATE DATABASE seafile_db CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'seafile_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON seafile_db.* TO 'seafile_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Make sure to replace your_password
with a secure password.
Step 4: Download Seafile
Now, download the latest Seafile server version. Go to the official download page to find the latest version:
wget https://download.seafile.com/seafile-server/latest/seafile-server_9.0.10_x86-64.tar.gz
Extract the downloaded archive:
tar -xzf seafile-server_9.0.10_x86-64.tar.gz
Move the extracted folder:
sudo mv seafile-server-9.0.10 /opt/seafile
Step 5: Configure Seafile
Navigate to the Seafile directory and configure it:
cd /opt/seafile
Run the setup script:
sudo ./setup-seafile.sh
You will be prompted to enter the following information:
- Database type: MySQL
- MySQL host: localhost
- MySQL user: seafile_user
- MySQL password: your_password
- MySQL database: seafile_db
- Seafile server name: your_server_name
Make sure to replace your_password
and your_server_name
with appropriate values.
Step 6: Start Seafile Server
Start the Seafile server by running the following commands:
cd /opt/seafile
sudo ./seaf-server start
Step 7: Access Seafile Web Interface
Open a web browser and navigate to http://your_server_ip:8000
. You should see the Seafile web interface. Follow the prompts to create an administrator account and configure your Seafile instance.
Step 8: Enable Seafile to Start on Boot (Optional)
If you want Seafile to start automatically on system boot, create a systemd service file:
sudo nano /etc/systemd/system/seafile.service
Paste the following content into the file:
[Unit]
Description=Seafile Server
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/seafile
ExecStart=/opt/seafile/seaf-server run
Restart=on-failure
[Install]
WantedBy=multi-user.target
Save and exit, then enable and start the service:
sudo systemctl enable seafile
sudo systemctl start seafile
Conclusion
You have successfully installed Seafile Self-Hosted Cloud Storage on Debian 12. You can now use your self-hosted Seafile instance to store and share files.