Cloudreve 4.19.1
Overview
Cloudreve is an open-source, self-hosted cloud drive written in Go. You upload, organise, preview and share files from a web interface. Several people can use one server, each with their own space and quota, organised in groups.
This guide covers the SecureAnyCloud Cloudreve 4.19.1 on Ubuntu 24.04 AMI on Amazon EC2. It is one version of the SecureAnyCloud file sharing and sync listing on AWS Marketplace. You pick it as the software version when you subscribe and launch. The image locks Cloudreve down, so it is ready to use as soon as it boots.
What you get:
- A full-featured drive. Folders, search, file versions, a trash bin, photo, video and document views, and share links with optional passwords and expiry.
- WebDAV access for desktop sync tools and file managers, and storage policies that an administrator can add to keep files on the instance's disk or in S3-compatible object storage.
- HTTPS from the first boot. nginx serves Cloudreve on port 443 with a certificate generated on your instance's first boot. Port 80 redirects to HTTPS, and requests for a host name the instance does not serve are dropped.
- No default login and no open sign-up. Cloudreve makes the first account that registers its administrator and leaves self-registration open. On this image, first boot registers the administrator with a random password unique to your instance while the web server is still down, so nobody can register first. It then switches self-registration off, checks that an anonymous registration is refused, and only then publishes the site. The sign-in is in
/root/cloudreve-credentials.txt(root only). - Secrets unique to your instance. The image ships with no configuration file, no database and no certificate. First boot writes the session secret. Cloudreve's own first start creates the database with its token signing key, ID salt and file encryption master key, all generated on your instance.
- Cloudreve stays on localhost. It listens on 127.0.0.1:5212 only, as an unprivileged
cloudreveaccount that can write nothing but its own data directory. It is blocked at the kernel level from reaching the EC2 instance metadata service, and it keeps normal outbound access for S3 storage policies and e-mail. - A hardened web front. nginx sets the client address itself, so a forged
X-Forwarded-Forheader is ignored. It strips cross-origin (CORS) headers and keeps query strings out of its access log, because signed download links carry their signature there. It rate-limits sign-in and registration, and refuses cross-site requests to the two administrator pages that make Cloudreve contact another server. - Built from source with current security fixes. SecureAnyCloud compiles Cloudreve 4.19.1 from the project's own release tag with the current Go toolchain and patched Go libraries. The upstream release binary is built with an older Go release that has since received many security fixes. The web interface is the project's own build, unchanged. The build is reproducible, and its record is on the image.
- A fully patched Ubuntu 24.04 LTS base at build time, with unattended security upgrades switched on.
- 24/7 SecureAnyCloud support
The image contains Cloudreve 4.19.1 (/opt/cloudreve/cloudreve, GPL-3.0, community edition), nginx, Ubuntu 24.04 LTS, cloud-init and the AWS Systems Manager agent. The licence, the source location, the exact Go module list and the build record are in /usr/share/doc/sac/cloudreve/.
Default user: ubuntu. Architecture: x86_64. Recommended instance type: m5.large.
Prerequisites
- An AWS account subscribed to the listing, an EC2 key pair and a VPC subnet with a route to the internet
- A security group that allows TCP 22 (SSH), TCP 443 (the web interface and WebDAV) and TCP 80 (redirects to HTTPS) from your own networks only
Launch the instance
In the AWS Marketplace listing, choose Continue to Subscribe, then Continue to Configuration. Pick Cloudreve 4.19.1 on Ubuntu 24.04 as the software version, choose your Region, and select Launch through EC2.
Choose m5.large, your key pair, a security group as described above, and a subnet. The AMI has an 8 GiB root volume, and uploaded files are stored on it (/var/lib/cloudreve/data). Raise the root volume under Configure storage to fit the files you plan to keep, or add an S3 storage policy later (Step 8).
To launch with the AWS CLI instead, replace the values in angle brackets. This command sets the root volume to 100 GiB:
aws ec2 run-instances --region <region> --image-id <ami-id-from-the-listing> \
--instance-type m5.large --key-name <your-key-pair> \
--security-group-ids <your-security-group> --subnet-id <your-subnet> \
--metadata-options HttpTokens=required,HttpEndpoint=enabled \
--block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=100,VolumeType=gp3}' \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=cloudreve}]'Connect to your instance
Connect over SSH as the ubuntu user. Software version and SSH user:
Cloudreve 4.19.1 on Ubuntu 24.04: ubuntu
ssh -i <your-key.pem> ubuntu@<public-ip>Check the services
First boot generates the certificate, the configuration, the database and the administrator, then publishes the site. This takes about ten seconds. Confirm that all three services are active:
systemctl is-active cloudreve-firstboot cloudreve nginxactive active activeList the listening ports. Only SSH (22) and nginx (80, 443) listen on the network. Cloudreve (5212) listens on loopback, and the two port 53 entries are Ubuntu's local DNS resolver:
sudo ss -lntp | awk 'NR>1 {print $4}' | sort -u0.0.0.0:22 0.0.0.0:443 0.0.0.0:80 127.0.0.1:5212 127.0.0.53%lo:53 127.0.0.54:53 [::]:22 [::]:443 [::]:80Query the health endpoint, which needs no sign-in, to see the Cloudreve version:
curl -sk https://127.0.0.1/api/v4/site/ping | python3 -c 'import json,sys; print(json.load(sys.stdin)["data"])'4.19.1If nginx serves nothing, first boot has not finished or has failed. When first boot fails, the site is never published. Check systemctl status cloudreve-firstboot and journalctl -u cloudreve-firstboot.
Get your URL and password
Read the credentials file as root:
sudo cat /root/cloudreve-credentials.txtOnly root can read the file. It holds the site address and this instance's administrator sign-in:
# Cloudreve on Ubuntu 24.04 (sac AWS Marketplace image) - this instance's administrator sign-in. # Generated on this instance at first boot; unique to it and not known to sac or the Cloudreve project. ... CLOUDREVE_URL=https://ec2-203-0-113-10.compute-1.amazonaws.com/ cloudreve.admin.email=admin@cloudreve.local cloudreve.admin.password=<CLOUDREVE_ADMIN_PASSWORD>Optionally, confirm the sign-in from the instance itself. The helper signs in through nginx and checks that a wrong password and a new registration are refused. It then prints CLOUDREVE_ROUNDTRIP_OK:
sudo /usr/local/sbin/cloudreve-verify.sh | tail -1CLOUDREVE_ROUNDTRIP_OKThe certificate is self-signed until you install your own (Step 9). Before you accept it in the browser, compare its SHA-256 fingerprint with the one the browser shows:
sudo openssl x509 -in /etc/ssl/cloudreve/cloudreve.crt -noout -fingerprint -sha256sha256 Fingerprint=3F:A1:...:7CSign in
Open the CLOUDREVE_URL address in your browser. Accept the certificate once, after comparing the fingerprint. Enter the e-mail address admin@cloudreve.local, choose Next, then enter the password from Step 4.
Change the administrator password now. Open Settings (the gear icon at the top right), then Password and security, and set a password of your own. You can also add a passkey or two-factor authentication there.
The password in /root/cloudreve-credentials.txt stops working once you change it. Delete the file after you have stored the new password safely. nginx allows two sign-in attempts a second per address, with a short burst, so a script hammering the sign-in page is slowed down with HTTP 429.
Upload and share files
Open My Files, which is your drive. Use New to upload files or folders, or to create folders. You can also drag files onto the page. Large files are uploaded in chunks, so uploads of many gigabytes work through the browser.
Right-click a file or folder, or use its menu, and choose Share. Cloudreve creates a link that you can protect with a password and an expiry. Your links are listed under Shared by me.
Anyone with the link can download without an account. Download links that Cloudreve hands out carry a signature and expire, and they always use your instance's configured address.
Connect over WebDAV
Open Connect & Mount and choose Create new account to make a WebDAV account. You can limit it to one folder and make it read-only.
Cloudreve shows the WebDAV address (https://<your-host>/dav), the account name and a generated password. Use them in your file manager, a sync tool such as rclone, or a mobile app.
Administer users, groups and storage
Open Dashboard in the left bar to reach the administration pages:
- Users: create an account for each person. Self-registration is off on this image. To let people sign up themselves, switch registration on under Settings, and consider enabling e-mail activation and a captcha there too.
- Groups: set quotas and permissions. New users join the User group (1 GB quota, sharing on). The Admin group has 1 TB. Raise the quotas to suit your disk.
- Storage Policy: the default policy stores files on the instance under
/var/lib/cloudreve/data/uploads. Add an S3-compatible policy (Amazon S3, MinIO, Cloudflare R2 and others) to keep files in object storage instead, and assign it to a group.
Some administration entries carry a Pro badge. They belong to Cloudreve Pro, a separate commercial edition from the Cloudreve project that is not part of this image. Choosing them only shows information about it. The Summary page also shows the project's announcement board, which your browser loads from GitHub.
Remote Download fetches a URL or a torrent into your drive. It needs a separate downloader service that this image does not include, so it is not available out of the box.
Use your own host name and certificate
Point a DNS record at the instance. An Elastic IP keeps the address across stop and start. Then tell the instance its name with the command below.
The command creates a new self-signed certificate for that name. It updates the nginx host rule, the cross-site guard, the address Cloudreve uses in its links and the address in the credentials file. It also keeps the name across reboots.
sudo cloudreve-set-hostname files.example.comTo use a certificate from a public authority instead, replace /etc/ssl/cloudreve/cloudreve.crt (full chain) and /etc/ssl/cloudreve/cloudreve.key (mode 0600, owned by root) with your own. Then run sudo systemctl reload nginx.
Running cloudreve-set-hostname again later replaces your certificate with a new self-signed pair.
Check persistence and updates
Every service is enabled, so Cloudreve returns after a reboot or a stop and start. If the public address changes, the next boot re-issues the certificate and the address for the new name, unless you set your own name in Step 9. Unattended security upgrades keep the operating system and nginx patched. Confirm that the units are enabled:
systemctl is-enabled cloudreve cloudreve-set-host nginx unattended-upgradesenabled enabled enabled enabledCloudreve itself is a single program, /opt/cloudreve/cloudreve, built by SecureAnyCloud from the 4.19.1 source. The file /usr/share/doc/sac/cloudreve/BUILD-PROVENANCE.txt records how. SecureAnyCloud publishes a new version of this image for new Cloudreve releases.
To move to a newer release yourself, read the release notes first, because a new release may migrate the database. Back up (Step 11), then replace the program with the new release from the Cloudreve releases page (the linux_amd64 archive). Finally, run sudo systemctl restart cloudreve.
Back up your files
Everything Cloudreve keeps is under /var/lib/cloudreve/data (the SQLite database cloudreve.db and the uploaded files), plus its configuration at /etc/cloudreve/conf.ini. Keep the database and the files together, because the database holds the file index and the encryption key for any files you store encrypted.
An EBS snapshot of the root volume, or AWS Backup on the instance, captures everything. For a file-level copy, stop Cloudreve briefly:
sudo systemctl stop cloudreve
sudo tar czf cloudreve-backup.tar.gz -C / var/lib/cloudreve/data etc/cloudreve/conf.ini
sudo systemctl start cloudreveBack up files kept in an S3 storage policy with your bucket.
Security notes
- No shared secret ships in the image. No password, configuration file, database, signing key or TLS key exists until your instance's first boot generates them. The site is not published until the administrator exists and self-registration is proven closed.
- Fail closed. If first boot cannot complete, nothing is published. nginx has nothing to serve, and Cloudreve does not start.
- Cloudreve is confined. It listens on 127.0.0.1 only and runs as an unprivileged account that can write only
/var/lib/cloudreve/data. It cannot change its own program or configuration, holds no Linux capabilities, writes no core dumps and cannot read the TLS key or root's files. It is blocked from the EC2 instance metadata service, as are nginx and the first-boot service. - PDF preview works, and scripts embedded in PDFs are disabled. Cloudreve's built-in PDF viewer (pdf.js 4.10.38) would run JavaScript embedded in a PDF on your Cloudreve site when someone previews it. nginx answers the viewer's scripting component with 404, so PDFs still open and render but their scripts never run. No Cloudreve file is changed. The details are in
/usr/share/doc/sac/cloudreve/SOURCE.txt. - Cross-site requests are refused for the two administrator pages that make Cloudreve contact another server: the WOPI discovery lookup and the cloud storage authorisation check. Cloudreve signs requests with a token rather than a cookie, so other web pages cannot act as you.
- Known open issues upstream. Two advisories have no fixed Cloudreve release yet. GHSA-vx2m-jpxr-xv7w (medium): after you revoke someone's access to a share, a link they had already opened can still be refreshed for a while. GHSA-w8j7-39hp-8x59 (low): a remote downloader can place files outside the chosen folder, and no downloader is installed here. SecureAnyCloud will publish an updated version when fixes are released. Every other published Cloudreve advisory is fixed in 4.19.1.
- Go libraries. The Go vulnerability scanner finds no reachable vulnerability in this build. It still lists four library advisories that have no fix or that Cloudreve never calls: two in the old AWS SDK's client-side S3 encryption (GO-2022-0635, GO-2022-0646), the deprecated OpenPGP package (GO-2026-5932) and a captcha library check (GO-2023-2386).
- Restrict network access. Limit 22/tcp to your management network, and 80/443 to the networks that use the drive.
Architecture summary
Component and detail:
File drive Cloudreve 4.19.1 (GPL-3.0, community edition, SecureAnyCloud source build), cloudreve.service, 127.0.0.1:5212, account cloudreve
Web server nginx on 443 (HTTPS, per-instance certificate in /etc/ssl/cloudreve), 80 redirects to HTTPS; WebDAV at /dav
Data /var/lib/cloudreve/data (SQLite database cloudreve.db, uploads/), owner cloudreve
Configuration /etc/cloudreve/conf.ini (listener, session secret, database path; generated at first boot), /etc/cloudreve/cloudreve.env (site address)
Credentials /root/cloudreve-credentials.txt, mode 0600, root only
First boot cloudreve-firstboot.service; host name and certificate cloudreve-set-host.service (every boot)
Tools cloudreve-set-hostname, cloudreve-verify.sh
Ports 22 SSH, 80 redirect, 443 web interface, REST API and WebDAV
Base image Ubuntu 24.04 LTS, fully patched, unattended security upgrades enabled, IMDSv2 required
Support
SecureAnyCloud images come with 24/7 support. Email sales@secureanycloud.com with your AWS account ID and the instance ID. For questions about Cloudreve itself, see the Cloudreve documentation and the Cloudreve project on GitHub.
Cloudreve is an open-source project. SecureAnyCloud is not affiliated with or endorsed by the Cloudreve project.
Deploy on AWS
Launch Cloudreve 4.19.1 on Ubuntu 24.04 on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com