Setting up a file server doesn't require heavy web panels or complicated apps. The most efficient way is to use Nginx and Aria2 to deploy a download server on storage VPS environment.
In this guide, you will learn a complete setup for your Storage VPS. By combining Nginx's native directory indexing for serving files with Aria2's powerful RPC capabilities for fetching them remotely, you can build a fast and resource-friendly download station that consumes almost no system overhead.
Install Required Packages to Deploy Download Server on Storage VPS
To follow this guide, you need a Storage VPS, which you can check PerLod Hosting plans for reliable plans.
Once you are logged into your server, the first step is to update your system and install the required packages, including Nginx and Aria2:
sudo apt update && sudo apt upgrade -ysudo apt install nginx aria2 -y
Nginx will be used to serve files, and Aria2 to download them.
Set up the Download Directory
At this point, you need a dedicated place to store all your downloaded files. You can create a new folder and set the correct permissions so Nginx can publicly serve whatever Aria2 downloads into it. To do this, run the commands below:
sudo mkdir -p /var/www/downloadssudo chown -R www-data:www-data /var/www/downloadssudo chmod -R 755 /var/www/downloads
Configure Nginx File Index for Download Server
Now you must configure Nginx to display a clean directory listing instead of looking for a default web page. You can set Nginx to serve your download folder and enable file indexing, so every completed Aria2 download displays instantly at your server URL.
Create a new Nginx configuration file with your desired text editor:
sudo nano /etc/nginx/sites-available/downloads
Paste the following configuration into the file with your actual VPS IP or domain:
1server {2 listen 80;3 server_name your_server_ip;4 root /var/www/downloads;5 6 location / {7 autoindex on;8 autoindex_exact_size off;9 autoindex_localtime on;10 charset utf-8;11 }12}
autoindex on;: Enables the directory listing module.
autoindex_exact_size off;: Displays file sizes in a readable format, such as KB, MB, and GB instead of exact bytes.
autoindex_localtime on;: Shows file timestamps in your server's local time zone.
Enable the configuration, remove the default config file, and restart Nginx to apply the changes:
sudo ln -s /etc/nginx/sites-available/downloads /etc/nginx/sites-enabled/sudo rm /etc/nginx/sites-enabled/defaultsudo systemctl restart nginx
Configure Aria2 in RPC Mode
Aria2 needs to run as a background service, RPC mode, so you can send download links to it remotely. You can run Aria2 as the www-data user so Nginx can easily read the downloaded files without any permission errors.
Create the configuration directory and session file with the commands below:
sudo mkdir -p /etc/aria2sudo touch /etc/aria2/aria2.sessionsudo chown -R www-data:www-data /etc/aria2
Note: Aria2 session file creates an empty file that Aria2 uses to save download progress. If the server reboots, unfinished downloads will resume.
Create the Aria2 configuration file with your desired text editor:
sudo nano /etc/aria2/aria2.conf
Paste the following configuration into the file:
1dir=/var/www/downloads2enable-rpc=true3rpc-listen-all=true4rpc-listen-port=68005rpc-secret=YOUR_SECURE_TOKEN_HERE6continue=true7input-file=/etc/aria2/aria2.session8save-session=/etc/aria2/aria2.session9save-session-interval=6010max-concurrent-downloads=5
This configuration sets up Aria2 as a remote-controlled service that saves up to 5 simultaneous downloads directly to your Nginx folder, protects access with a secure password, and automatically resumes any interrupted files if your server reboots.
Create a Systemd Service File for Aria2
To ensure Aria2 starts automatically when your VPS boots, you can create a systemd unit file for it. To do this, you can run the command below:
sudo nano /etc/systemd/system/aria2.service
Add the following configuration to the file:
1[Unit]2Description=Aria2c RPC Service3After=network.target4 5[Service]6Type=simple7User=www-data8Group=www-data9ExecStart=/usr/bin/aria2c --conf-path=/etc/aria2/aria2.conf10Restart=on-failure11 12[Install]13WantedBy=multi-user.target
Once you are done, reload systemd, enable, and start the Aria2 service:
sudo systemctl daemon-reloadsudo systemctl enable aria2sudo systemctl start aria2
Test Download Server on Storage VPS
At this point, you can test your setup by opening your web browser and visiting the following URL:
You must see an empty Index of / page.
Your server is now actively listening on port 6800. You can connect to it using any Aria2 WebUI like AriaNg or a browser extension by entering your server IP, port 6800, and the rpc-secret token you defined in the previous steps.
When a download finishes in Aria2, you will immediately see it on your server's web page.
Conclusion
At this point, you have a download server on Storage VPS by using Nginx as a simple file indexer and Aria2 for fetching files directly into your download folder. If you want an easier workflow, you can manage everything from your browser by connecting an Aria2 WebUI like AriaNg to your server’s RPC endpoint.
We hope you enjoy using this guide. Subscribe to our X and Facebook channels to get the latest updates and articles.
For further reading:
Configure Secure NFS File Shares for Backups and Media
Set up an Automated Backup System with Borg