Skip to content

Ubuntu Clash proxy configuration

If you were born in an authoritarian country where human rights are being trampled, at the mean while you aspire to associate with the civilized world, you need a tool to bypass the firewall and keep in touch with the civilized world. Clash is one of them. This article records the process of using Clash to surf the Internet on Ubuntu system.

Download

Go to https://github.com/Dreamacro/clash/releases to download the latest version of Clash precompiled files for Linux, for example: clash-linux-amd64-v1.11.12.gz.

Install

Unzip the downloaded file, and move the extracted clash-linux-amd64 to the ~/opt/clash folder.

Copy config.yaml to ~/.config/clash/ folder. config.yaml can be obtained from your subscription service provider or from the clash client for android or windows.

Create a new /etc/systemd/system/clash.service file and add the following content.

Note: The part in bold needs to be replaced with the corresponding directory of your computer.

[Unit]
Description=Clash daemon, A rule-based proxy in Go.
After=network.target

[Service]
Type=simple
Restart=always
ExecStart=/absolutely_dir_path/opt/clash/clash-linux-amd64 -d /absolutely_dir_path/.config/clash

[Install]
WantedBy=multi-user.target

Start the service.

sudo systemctl enable clash
sudo systemctl start clash

Browser configuration

Set the socks5 proxy of the browser to 127.0.0.1: port, the port is usually 7890, you can check it in config.yaml for details.

Open https://clash.razord.top/ and select the corresponding proxy node.

Leave a Reply