How to Set aria2 RPC Listening Port?

The aria2c command-line download utility allows users to enable a Remote Procedure Call (RPC) server for remote management and automation. When starting this server, you can customize the specific port it listens on by using a dedicated command-line flag. This article explains exactly which flag to use, how to implement it in your command terminal, and how to verify that the port is actively listening.


The aria2 RPC Port Flag

To specify the listening port for the aria2 RPC server, use the --rpc-listen-port flag.

By default, if you enable the RPC server without specifying a port, aria2 will listen on port 6800. However, if that port is already in use by another application, or if you want to change it for security and configuration reasons, you can append this flag followed by your desired port number.

Basic Command Usage

To start the aria2 RPC server on a custom port, you must combine the --enable-rpc flag with the --rpc-listen-port flag.

Here is the standard syntax:

aria2c --enable-rpc --rpc-listen-port=8080

In this example, the RPC server is explicitly instructed to listen for incoming connections on port 8080 instead of the default 6800.

Combining with Security Flags

When changing the RPC port, it is highly recommended to also secure the connection using a secret token. This prevents unauthorized users from controlling your downloads.

aria2c --enable-rpc --rpc-listen-port=9000 --rpc-secret=YourSecureTokenHere

Verifying the Configuration

After running the command, you can verify that aria2 is listening on your custom port by checking your system’s active network connections.