How to Install Tor on Linux: A Practical Step-by-Step Guide
If you're looking to enhance your online privacy and browse the internet anonymously, Tor is one of the best tools available. Tor (The Onion Router) routes your traffic through multiple volunteer-operated servers to help conceal your identity and location. In this post, we'll walk through how to install and run Tor on a Linux system.
Why Use Tor on Linux?
Linux users often value privacy and open-source tools, making Tor a perfect fit. Whether you want to access the dark web safely or just want extra security when browsing, setting up Tor on Linux is straightforward if you follow these steps.
Step 1: Update Your System
Before installing any new package, make sure your system is up-to-date.
sudo apt update && sudo apt upgrade -y
Note: The following instructions assume you're using a Debian-based distro like Ubuntu. Commands for other distros like Fedora or Arch will differ slightly.
Step 2: Add the Official Tor Repository (Recommended)
It's best to install Tor from the official repository maintained by The Tor Project so that you get timely updates and better security.
- Add the GPG key for package verification:
wget -qO - https://deb.torproject.org/torproject.org/gpgkey | gpg --dearmor | sudo tee /usr/share/keyrings/tor-archive-keyring.gpg
- Add the Tor repository:
For Ubuntu 20.04 (Focal), add this line:
echo "deb [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org focal main" | sudo tee /etc/apt/sources.list.d/tor.list
Replace focal
with your Ubuntu codename (e.g., bionic
for 18.04).
- Update your package list to include the new repo:
sudo apt update
Step 3: Install Tor
Now that the repo is added:
sudo apt install tor deb.torproject.org-keyring -y
This installs both Tor and its keyring for secure updates.
Step 4: Verify Installation
Check if the tor
service is running:
systemctl status tor
Look for active (running)
in green text. If not running:
sudo systemctl start tor
sudo systemctl enable tor # Starts on boot
Step 5: Use Tor with Tor Browser or Command Line
-
To browse via GUI: Download and install Tor Browser separately. It's tailored for privacy with a pre-configured browser environment.
-
To route other applications through Tor (Advanced):
You can configure your apps to use Tor's SOCKS proxy at localhost port 9050.
For example:
curl --socks5 localhost:9050 https://check.torproject.org/api/ip
This command queries your current IP via the proxy; if successful, it will display a message confirming you’re connected via Tor.
Optional: Install torbrowser-launcher
(Ubuntu)
For an easier way to install and keep Tor Browser updated:
sudo apt install torbrowser-launcher -y
torbrowser-launcher
This tool downloads and launches the latest official Tor Browser.
Troubleshooting Tips
-
Tor not starting? Check logs with:
journalctl -xeu tor.service
-
Firewall blocking? Ensure ports required by Tor aren't blocked in
ufw
or other firewalls. -
Check connectivity: Run
telnet check.torproject.org 443
to see if external connections work properly.
Final Thoughts
Installing and running Tor on Linux doesn’t have to be complicated. By adding official repositories and using system services, you ensure ongoing security updates with minimal fuss. Whether you're safeguarding personal data or exploring onion sites safely, having Tor installed properly is a powerful step toward online privacy.
Give it a try today—your anonymity awaits!
Have questions or need help setting this up? Drop a comment below!