How To Install Tor Browser on CentOS 7 | Secure Browser
In this guide, you will learn How To Install Tor Browser on CentOS 7. The Tor (the onion routing) browser is a web browser designed for anonymous web surfing and protection against traffic analysis. Although Tor is often associated with the darknet and criminal activity, law enforcement officials, reporters, activists, whistleblowers, and ordinary security-conscious individuals often use the browser for legitimate reasons.
The Tor browser works by using a technology known as onion routing. The onion router is a peer-to-peer (P2P) overlay network that enables users to browse the internet anonymously. Onion routing uses multiple layers of encryption to conceal both the source and destination of information sent over the network. It is designed so that no one can monitor or censor online communication.
Once a user installs Tor, the browser uses Tor servers to send data to an exit node, which is the point at which data leaves the network. Once this data has been sent, it is encrypted multiple times before being sent to the next node. Repeating this process makes it difficult to trace the data back to the source. In addition to encryption, the Tor browser does not track browsing history or store cookies.
You can now proceed to the guide steps below to set up How To Install Tor Browser on CentOS 7.
To complete this guide on How To Install Tor Browser on CentOS 7, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on the Initial Server Setup with CentOS 7.
1. Create a Yum Repository For Tor Web Browser
The Tor development team provides an official yum repository for the Tor browser installation. You can find the latest available packages by visiting rpm.torproject.org.
First, you need to install the EPEL repository on CentOS 7:
sudo yum install epel-release -y
Now, create a new file /etc/yum.repos.d/tor.repo
with your favorite text editor, here we use vi:
sudo vi /etc/yum.repos.d/tor-browser.repo
Add the following content to the file:
[Tor]
name=Tor for Enterprise Linux $releasever - $basearch
baseurl=https://rpm.torproject.org/centos/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://rpm.torproject.org/centos/public_gpg.key
cost=100
When you are done, save and close the file.
Then, update your local package index with the command below:
sudo yum update -y
2. Install Tor Browser on CentOS 7
At this point, you have successfully added the Tor browser repository to your system. Next, use the yum command to install Tor Browser on your CentOS 7:
sudo yum install tor -y
When your installation is completed, you can verify your Tor installation by checking its version:
tor --version
In your output, you will see:
Important Note: It is highly recommended to use the Tor browser bundle, but if you want to use Firefox with Tor, once you have started the service, open firefox settings >> Preferences >> advanced >> network >> settings and select manual proxy configuration.
On successful command execution, you will have installed the Tor browser on your server. Now you can launch the application on your Desktop system.
Conclusion
Installing the Tor Browser on CentOS 7 is a simple process that enhances your online privacy and security. Though CentOS 7 is a bit dated, the Tor Browser remains compatible and offers a secure browsing experience right out of the box. Now you know How To Install Tor Browser on CentOS 7
Hope you enjoy it. You may be like these guides:
Secure MySQL Connections with SSL on CentOS 7
Install and Configure ProFTPD on CentOS 7
Install and Configure CSF firewall on CentOS 7
Alternative Solutions for Installing Tor Browser on CentOS 7
While the YUM repository method is straightforward, other approaches exist for installing the Tor Browser on CentOS 7, each with its own advantages and disadvantages. Here are two alternative methods:
1. Installing Tor Browser Bundle from Source (using the GUI)
This method involves downloading the Tor Browser Bundle directly from the Tor Project website and extracting it. This allows more control over the installation location and provides a more up-to-date version than what might be available in older repositories.
Steps:
-
Download the Tor Browser Bundle: Open a web browser (like Firefox, if you have it) and navigate to the official Tor Project download page:
https://www.torproject.org/download/
. Download the appropriate Linux version (usually a.tar.xz
file). -
Verify the Download: It’s crucial to verify the integrity of the downloaded file. The Tor Project provides a signature file alongside the download. Download the signature file (it will have a
.asc
extension). -
Import the Tor Project GPG Key: If you haven’t already, import the Tor Project’s signing key:
gpg --keyserver keys.openpgp.org --recv-keys 0xEF6E286DDA85EA2A4BA7DE684E2C6E8793298290
-
Verify the Signature: Use
gpg
to verify the downloaded.tar.xz
file against the downloaded.asc
signature file. Navigate to the directory where you downloaded the files in your terminal and run:gpg --verify tor-browser-linux64-12.0.7_en-US.tar.xz.asc tor-browser-linux64-12.0.7_en-US.tar.xz
(Replace
tor-browser-linux64-12.0.7_en-US.tar.xz
andtor-browser-linux64-12.0.7_en-US.tar.xz.asc
with the actual filenames you downloaded.)A "Good signature" message from a key matching
4E2C6E8793298290
indicates a successful verification. This is a critical security step. -
Extract the Bundle: Use the
tar
command to extract the contents of the downloaded file. Navigate to the directory where the file is located in your terminal and run:tar -xf tor-browser-linux64-*.tar.xz
This will create a directory named
tor-browser_*
in the current directory. -
Run the Tor Browser: Navigate into the extracted directory:
cd tor-browser_*
Then, start the Tor Browser:
./start-tor-browser.desktop
This should launch the Tor Browser setup wizard.
Explanation:
This method bypasses the system’s package manager entirely. It relies on the user to download, verify, and extract the Tor Browser Bundle. Verification is paramount to ensure the downloaded file hasn’t been tampered with. This method provides greater control but requires more manual steps and a higher degree of user awareness.
2. Using Docker to Run Tor Browser (GUI-less for server applications)
If you need Tor functionality on a CentOS 7 server without a graphical interface (for example, to route traffic from a web application through Tor), you can use Docker to containerize the Tor process. This provides isolation and simplifies management.
Steps:
-
Install Docker: If Docker isn’t already installed, install it:
sudo yum install -y docker sudo systemctl start docker sudo systemctl enable docker
-
Run a Tor Docker Container: There are pre-built Docker images for Tor. A simple example is using the
dperson/torproxy
image.docker run -d --name tor-proxy -p 9050:9050 -p 9051:9051 dperson/torproxy
-d
: Runs the container in detached mode (in the background).--name tor-proxy
: Assigns a name to the container.-p 9050:9050
: Maps port 9050 on the host to port 9050 in the container (SOCKS proxy port).-p 9051:9051
: Maps port 9051 on the host to port 9051 in the container (Tor control port – use with caution).
-
Configure your Application to use the Tor Proxy: Configure your application (e.g., a Python script using
requests
) to use the SOCKS proxy atlocalhost:9050
.
Example Python Code:
import requests
proxies = {
'http': 'socks5://127.0.0.1:9050',
'https': 'socks5://127.0.0.1:9050',
}
try:
response = requests.get("https://check.torproject.org/", proxies=proxies)
print(response.text)
except requests.exceptions.RequestException as e:
print(f"Error: {e}")
Explanation:
This method utilizes Docker to create a contained environment for the Tor process. It eliminates the need to install Tor directly on the host system. The application then communicates with the Tor proxy running within the container. This is suitable for server-side applications needing Tor’s anonymity features. The dperson/torproxy
image is a popular choice, but always research and select Docker images from trusted sources. Using Docker isolates the Tor process and simplifies deployment and management, especially in complex server environments. It’s important to note that you will not be running the Tor Browser GUI in this case. It’s purely for routing traffic.