Introduction:

Cloudreve is a suitable network disk system for both personal and public use, supporting a variety of cloud storage platforms, such as Qiniu, OSS, COS, Upyun, OneDrive, S3. Users do not need to worry about the physical storage method during actual use. It can be used to build personal network disks, file sharing systems, as well as public cloud systems for groups of various sizes.

Deployment Method 1: Installation Using Docker

Step One: Update Sources

apt update -y && apt upgrade -y        #Ubuntu/Debian
yum update -y && yum upgrade -y        #Centos

Step Two: Install and Configure Docker

Install Docker:

curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh ./get-docker.sh

Start Docker:

sudo systemctl start docker

Set Docker to automatically start at boot:

sudo systemctl enable docker

Step Three: Install Aria2 (skip to step four if offline download is not required)

Remember to modify <TOKEN>

docker run -d \
    --name aria2-pro \
    --restart unless-stopped \
    --log-opt max-size=1m \
    -e PUID=$UID \
    -e PGID=$GID \
    -e UMASK_SET=022 \
    -e RPC_SECRET=<TOKEN> \
    -e RPC_PORT=6800 \
    -p 6800:6800 \
    -e LISTEN_PORT=6888 \
    -p 6888:6888 \
    -p 6888:6888/udp \
    -v $PWD/aria2-config:/config \
    -v $PWD/aria2-downloads:/downloads \
    p3terx/aria2-pro

Step Four: Create Directory Structure

mkdir -vp cloudreve/{uploads,avatar} \
&& touch cloudreve/conf.ini \
&& touch cloudreve/cloudreve.db

Step Five: Install and Start the Cloudreve Container

docker run -d \
-p 5212:5212 \
--mount type=bind,source=<path_to_your_config>,target=/cloudreve/conf.ini \
--mount type=bind,source=<path_to_your_db>,target=/cloudreve/cloudreve.db \
-v <path_to_your_uploads>:/cloudreve/uploads \
-v <path_to_your_avatar>:/cloudreve/avatar \
cloudreve/cloudreve:latest

After running, you can visit http://<your-ip>:5212 to access Cloudreve

Deployment Method 2: Building from the Packaged Main Program

Step One: Update Sources and Install Dependencies

Ubuntu/Debian:

apt update -y && apt upgrade -y    

Centos:

yum update -y && yum upgrade -y   

Step Two: Install and Configure Docker

Install Docker:

curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh ./get-docker.sh

Start Docker:

sudo systemctl start docker

Set Docker to automatically start at boot:

sudo systemctl enable docker

Step Three: Install Aria2 (skip to step four if offline download is not required)

Remember to modify <TOKEN>

docker run -d \
    --name aria2-pro \
    --restart unless-stopped \
    --log-opt max-size=1m \
    -e PUID=$UID \
    -e PGID=$GID \
    -e UMASK_SET=022 \
    -e RPC_SECRET=<TOKEN> \
    -e RPC_PORT=6800 \
    -p 6800:6800 \
    -e LISTEN_PORT=6888 \
    -p 6888:6888 \
    -p 6888:6888/udp \
    -v $PWD/aria2-config:/config \
    -v $PWD/aria2-downloads:/downloads \
    p3terx/aria2-pro

Step Four: Get Cloudreve

Get the packaged main program that has been built from the GitHub Release page. Choose the available main program for the suitable system architecture. The naming rule is cloudreve_VERSION_OS_CPU ARCH.tar.gz.

Step Five: Unzip and Execute the Main Program

tar -zxvf cloudreve_VERSION_OS_ARCH.tar.gz
chmod +x ./cloudreve
./cloudreve

Step Six: Deploy Process Guard

  1. Edit the configuration file
    vim /usr/lib/systemd/system/cloudreve.service
  2. Replace PATH_TO_CLOUDREVE with the directory where the program is located:

    [Unit]
    Description=Cloudreve
    Documentation=https://docs.cloudreve.org
    After=network.target
    After=mysqld.service
    Wants=network.target
    
    [Service]
    WorkingDirectory=/PATH_TO_CLOUDREVE
    ExecStart=/PATH_TO_CLOUDREVE/cloudreve
    Restart=on-abnormal
    RestartSec=5s
    KillMode=mixed
    
    StandardOutput=null
    StandardError=syslog
    
    [Install]
    WantedBy=multi-user.target
  3. Management commands:

    # Update configuration
    systemctl daemon-reload
    
    # Start service
    systemctl start cloudreve
    
    # Set to start on boot
    systemctl enable cloudreve
    
    # Stop service
    systemctl stop cloudreve
    
    # Restart service
    systemctl restart cloudreve
    
    # Check status
    systemctl status cloudreve

After running, you can visit http://<your-ip>:5212 to access Cloudreve

Tag:Configure, Cloud Storage, Cloudreve

Original link:http://enblog.fuyiran.link/Technology/19.html

Copyright: All posts on this blog, unless otherwise stated, are published using theCC BY-NC-SA 4.0 license agreement. Please indicate the source for reprinting Fu Speaking (enblog.fuyiran.link)

Add a new comment.