❌

Reading view

How to Setup SOCKS5 Proxy Server on Linux Using MicroSocks

VPNs are popular these days, but many users still prefer using a SOCKS proxy to tunnel network connections through them, as it offers faster internet connections and is ideal for managing torrent traffic, despite the generic drawback of unencrypted traffic.

You can even access blocked sites in your country using a SOCKS proxy. There are many public SOCKS proxy servers available, but as mentioned earlier, traffic on a SOCKS proxy is not encrypted, so using a public one could be risky.

In this article, I’ll show you how to install and set up a SOCKS5 proxy server on Linux using MicroSocks.

MicroSocks: A Lightweight SOCKS5 Proxy Server

MicroSocks is a lightweight and multi-threaded SOCKS5 proxy server designed to robustly handle requests on servers with low resources by consuming minimal resources and gently denying new connections during heavy loads instead of aborting them.

It supports IPv4, IPv6, DNS, uses TCP (no UDP currently) for network proxy, and allows users to connect with or without a password or by providing a one-time password, all without needing to create or edit any configuration file.

Let’s now see how to install MicroSocks on popular Linux distributions like Debian, Ubuntu, Linux Mint, Red Hat, Fedora, Rocky Linux, Arch, or any others.

Install MicroSocks on Linux

MicroSocks is available in most Linux repositories, such as Debian, Ubuntu-based distributions, and Arch systems, where you can quickly install it using one of the appropriate commands based on your Linux distribution.

# On Debian, Ubuntu, Kali Linux, Linux Mint, Zorin OS, Pop!_OS, etc.
$ sudo apt install microsocks

# On Arch Linux, Manjaro, BlackArch, Garuda, etc.
$ sudo pacman -S microsocks

On Red Hat and Fedora-based distributions, or on older Debian and Ubuntu distributions, you can build and install it from the source, which also provides you with the latest version.

To start, ensure the development tools are installed on your Linux system, then run the following series of commands to install MicroSocks from source.

$ wget http://ftp.barfooze.de/pub/sabotage/tarballs/microsocks-1.0.4.tar.xz
$ tar -xvf microsocks-1.0.4.tar.xz && cd microsocks*/
$ make && sudo make install

Once the installation is complete, the MicroSocks executable file will be added to the β€œ/usr/local/bin” directory.

Start MicroSocks SOCKS5 Proxy Server

Now that the installation is complete, the β€œmicrosocks” command is available to use, but before that, let’s look at a few options you can use with it.

OptionDescription
β€œ-1β€œIt allows you to authenticate once, after which your IP address will be included in a whitelist, enabling you to connect to the proxy server later without authentication.
β€œ-qβ€œDisable logging.
β€œ-i ip-addressβ€œSpecify the IP address to listen on; not providing one means listening on all network interfaces in the server (default is β€œ0.0.0.0β€œ).
β€œ-p portβ€œSet the port to use for listening (default is β€œ1080β€œ).
β€œ-u user” and β€œ-P passwordβ€œSpecify the username and password for authentication in plain text, which can be anything regardless of existing users on the server.

In my case, I’ve set up the MicroSocks proxy server on a DigitalOcean VPS and started it using the following command, which listens on all server IPs with port 8484, the username β€œproxyuserβ€œ, and the password β€œsecurepasswordβ€œ.

$ microsocks -1 -p 8484 -u proxyuser -P securepassword

Output:

starting microsocks server

To connect to the above MicroSocks proxy server from the local machine, run the following command, replacing the green highlighted fields with the correct proxy server information.

$ curl --socks5 user:password@server-ip:port https://www.google.com/

Output:

connecting to microsocks proxy server

Once you do that, your local machine will be whitelisted for the MicroSocks proxy server due to the β€œ-1” option, allowing you to configure SOCKS5 with your browser or Linux system without providing credentials.

To connect to your MicroSocks proxy server from Firefox, navigate to β€œPreferencesβ€œ, then β€œGeneralβ€œ, scroll down to the β€œNetwork Settings” section, and click on β€œSettingsβ€œ.

firefox network settings

Then, ensure you enable manual proxy configuration, select SOCKS v5, and provide the host and port number of your SOCKS5 proxy server.

configuring SOCKS5 on firefox

Your Firefox is now configured with the MicroSocks proxy server, so all your browsing will go through the proxy server. If you encounter a connection failure error, make sure to re-execute the previous curl command.

To connect your local machine (running on GNOME) with the MicroSocks proxy server, first open β€œSettingsβ€œ, navigate to β€œNetworkβ€œ, and then β€œProxyβ€œ.

navigating to proxy section

Next, toggle the β€œNetwork Proxy” and choose the β€œManual” configuration.

enabling proxy configuration

Finally, enter the host and port of your MicroSocks proxy server in the β€œSOCKS5 HOST” section and save the changes.

configuring SOCKS5 on ubuntu

You now have your system running on GNOME, connected to your MicroSocks proxy server.

Allow MicroSocks Proxy Server Listening Port on Firewall

If you are running an Ubuntu system with UFW (Uncomplicated Firewall), you need to open the port your proxy server listens on. First, check the firewall status:

$ sudo ufw status

If it’s active and running, then open the port for the MicroSocks proxy server, which by default is 1080; however, since I’ve opted for a custom port of 8484 using the β€œ-p” option, I need to allow this port with the following command:

$ sudo ufw allow 8484/tcp

Output:

allowing firewall to microsocks proxy server

Create MicroSocks Proxy Server Systemd Service

To keep the MicroSocks proxy server running in the background and autostart on boot without any manual intervention, you can create a Systemd service.

To begin, open your terminal and create a Systemd service file using the command below.

$ sudo nano /etc/systemd/system/microsocks.service

Then copy-paste the following snippet.

πŸ“
If you’ve installed the MicroSocks proxy server from source, ensure to replace β€œ/usr/bin/microsocks” with β€œ/usr/local/bin/microsocksβ€œ. Additionally, you can add or remove the existing β€œ-u” and β€œ-P” options as needed.
[Unit]
Description=microsocks SOCKS5 server
Documentation=https://github.com/rofl0r/microsocks
After=network.target auditd.service

[Service]
EnvironmentFile=/etc/microsocks.conf
ExecStart=/usr/bin/microsocks -1 -u ${MICROSOCKS_LOGIN} -P ${MICROSOCKS_PASSW}

[Install]
WantedBy=multi-user.target

Save and close the file, then create a MicroSocks configuration file for the user and password variables used in the above Systemd service file.

$ sudo nano /etc/microsocks.conf

Copy and paste the following snippet, ensure to replace the user and password information with the correct MicroSocks proxy server details. Also, if you’ve customized the port or restricted IP in the Systemd service file, set their values accordingly in this configuration file.

# used by the systemd service file
MICROSOCKS_LOGIN="proxy-user"
MICROSOCKS_PASSW="proxy-password"

Save and close the file, then use the following command to enable and start the service:

$ sudo systemctl enable --now microsocks.service

To verify the status of the service, run the β€œsystemctl status microsocks” command.

checking MicroSocks service status

Uninstall MicroSocks from Linux

To uninstall the MicroSocks proxy server from your Linux system installed via the package manager, run:

# On Debian, Ubuntu, Kali Linux, Linux Mint, Zorin OS, Pop!_OS, etc.
$ sudo apt remove microsocks

# On Arch Linux, Manjaro, BlackArch, Garuda, etc.
$ sudo pacman -R microsocks

If you have installed it directly from the source, then run:

$ sudo rm /usr/local/bin/microsocks

To disable and remove the Systemd service, run:

$ sudo systemctl disable --now microsocks.service
$ sudo rm /etc/microsocks.conf

If you’ve allowed the MicroSocks listening port on UFW, then execute the following command to locate its index number:

$ sudo ufw status numbered

Then remove the corresponding port using the β€œsudo ufw delete [no]” command.

The post How to Setup SOCKS5 Proxy Server on Linux Using MicroSocks appeared first on Linux TLDR.

  •  

Hoarder: A Bookmark and Note Taking App (Install via Docker)

Hoarder is a fantastic app for keeping your notes, images, and bookmarks in a single place. It’s a free, open-source, and self-hostable application for bookmarking that offers AI-based automatic tagging and full-text search, powered by the one and only ChatGPT.

my hoarder dashboard

After giving it a try for five minutes, it immediately became my favorite application. To be honest, previously I used Pocket, which was quite annoying because it didn’t allow us to add notes or images; it was only for bookmarking pages.

Also, I don’t understand why they add the β€œ?utm_source=pocket_saves” slug to every page I bookmark. Don’t they realize that some sites are strict about CSRF? Well, let’s leave them aside, as I’ve already deleted my Pocket account.

Hoarder is a fun tool for quickly creating notes, saving links, and saving images. You can later add tags to your bookmarks and organize them into lists, like one for notes, another for links, or a separate list for images.

Interestingly, it also features a Chrome plugin and a Firefox addon that allow you to quickly bookmark pages, add tags, or add them to a list.

hoarder browser extension

The experience is remarkable, and it also provides an option to delete bookmarks directly from the extension, unlike Pocket, which forces us to remove bookmarks from the dashboard. (Alright, that’s my final rant.)

Features of the Hoarder

The following is a list of features offered by Hoarder:

  • Bookmark links, take simple notes, and store images.
  • Automatically retrieve link titles, descriptions, and images (excluding Captcha ones).
  • Modify bookmark titles, archive, favorite, or delete them.
  • Attach manual or AI-generated tags to bookmarks.
  • Organize bookmarks into custom lists.
  • Perform a full-text search across all stored content.
  • Chrome pluginΒ andΒ Firefox addonΒ for quick bookmarking.
  • AnΒ iOS app and an Android app.
  • Enjoy dark mode support (for now, only for the Web).

Install Hoarder Using Docker

Make sure your system has Docker and Docker Compose installed for a smooth Hoarder setup. If not, consider referring to our dedicated installation guide. Once you have them, you can quickly set up Hoarder on Linux, Windows, or macOS, whether locally or on cloud servers.

1. Create a new directory for storing the compose file and environment variables.

$ mkdir ~/hoarder/ && cd ~/hoarder/

Output:

creating directory for hoarder

2. Download the docker compose file inside the created directory by running this command:

$ wget https://raw.githubusercontent.com/hoarder-app/hoarder/main/docker/docker-compose.yml

Output:

download hoarder docker compose file

3. (Optional) To change the volume location, you can edit the docker compose file with your choice of text editor. To implement OpenAI’s automatic tagging, acquire an OpenAI API key and set it up in the docker compose file environment section.

configure OpenAI API key for hoarder

4. Create a β€œ.env” file in the same directory with the following content:

HOARDER_VERSION=latest
NEXTAUTH_SECRET=2fjLEIJKKl016/nJmlZnp2UpvaFCccwMkVan1ufigxqsuOtD
MEILI_MASTER_KEY=tZcjeGqwy8DEu7GqxbBupvLexsSSEit7FchT4WnAmi0ewxPb
NEXTAUTH_URL=http://localhost:3000

If you want to modify the secret keys, use β€œopenssl rand -base64 36” to generate new random strings for β€œNEXTAUTH_SECRET” and β€œMEILI_MASTER_KEYβ€œ. And when configuring Hoarder on a cloud server, make sure to update the β€œNEXTAUTH_URL” variable to match your server address.

5. Finally, you can start the Hoarder server by running this command:

$ docker compose up -d

Output:

running hoarder docker compose

Access the Hoarder Dashboard

Once the Hoarder is up and running on your system, you can launch your preferred browser (Chrome or Firefox) and navigate to the β€œhttp://localhost:3000” URL to access the dashboard.

hoarder login page

To begin using Hoarder, you need to first register a new account by providing your name, email, password, and confirming the password. The first account will be designated as the administrator of Hoarder.

creating hoarder account

Once you successfully create the account, you will be redirected to the Hoarder dashboard, where you can quickly start adding bookmark links, taking simple notes, or saving images, including attaching them with tags or adding them to lists.

hoarder dashboard

The default layout for the bookmarks is set to masonry, but it can be switched to grid or list view.

hoarder layout

To check the number of users, bookmarks, server version, and background jobs (crawling, indexing, and inference), navigate to the β€œAdmin” page.

hoarder admin page

Changing the current password or generating a new API key can be done from the β€œSettings” page.

hoarder settings page

You can further explore the Hoarder yourself, as it is very user-friendly. Happy exploring!

Stop Hoarder Using Docker

To stop the Hoarder service, navigate to the directory where the Hoarder docker compose file is stored and run the following command:

$ cd ~/hoarder/
$ docker compose down

Output:

removing hoarder docker container

Final Word

Hoarder is a fantastic app that I’ve been using for a while on my Homelab, and honestly, my experience with bookmarking has been great. The Hoarder installation method discussed in this article will seamlessly work on Windows, macOS, or Linux (including Ubuntu, Debian, Linux Mint, Fedora, Red Hat, Arch, Manjaro, and others).

If you have any questions regarding the topic, feel free to ask them in the comment section.

Till then, peace!

The post Hoarder: A Bookmark and Note Taking App (Install via Docker) appeared first on Linux TLDR.

  •