---
title: 'How to install SOCKS5 in Docker | Zomro'
description: 'To bypass the numerous restrictions that may be related to your location, you can use SOCKS technology.'
image: 'https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/11/01/1669736570_1.png'
---

![opened image]()

  * [Zomro](https://zomro.com/)
  * [FAQ](https://zomro.com/blog/faq/)
  * How to install SOCKS5 in Docker 



# How to install SOCKS5 in Docker

13-11-2022

To bypass numerous restrictions that may be related to your location, you can use the SOCKS technology. T  
  
In this article, we will discuss how to install it in a Docker container, also using docker-compose.  


**Let's install Docker.**

But first, you need to update the OS packages.   

    
    
    apt update

Let's install the necessary packages and add a new repository:  

    
    
    apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
    add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

  
Let's update the packages with the new repository:
    
    
    apt update

Now let's install Docker itself.
    
    
    apt-get install docker-ce docker-ce-cli containerd.io

Let's check the version:
    
    
    docker --version

  
![How to install SOCKS5 in Docker - 1](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/11/01/1669736570_1.png)Let's check the status:
    
    
    systemctl status docker

  
![How to install SOCKS5 in Docker - 2](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/11/01/1669736593_2.png)  
If it hasn't started, then start it:
    
    
    systemctl start docker
    

  
And add it to the autostart.
    
    
    systemctl enable docker
    

  
![How to install SOCKS5 in Docker - 3](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/11/01/1669736594_4.png)

**Let's install Docker-Compose**

  
For this project, version 1.25 will be sufficient. 
    
    
    curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    

Let's set the execution rights. 
    
    
    chmod +x /usr/local/bin/docker-compose
    

Let's check how Docker-Compose was installed:
    
    
    docker-compose --version
    

  
![How to install SOCKS5 in Docker - 4](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/11/01/1669740139_5.png)  
Let's add the Linux user to the **docker** group:
    
    
    usermod -aG docker $USER
    

  
Let's create a ***.yaml** file for Docker-Compose.  
  
To keep track of what we have installed in the future, let's create a separate folder for this project in the **/home** directory and navigate to it.
    
    
    mkdir /home/socks5 && cd /home/socks5

  
You can also use another directory**** to place this and other projects.   
  
Let's use the repository to create the **docker-compose.yaml** file at the link <https://hub.docker.com/r/xkuma/socks5>  
  
Let's create the file **docker-compose.yaml** or **docker-compose.yml** ,
    
    
    vim docker-compose.yaml
    

  
And add the following code to it:
    
    
    version: "2.1"
    services:
      socks5:
        image: olebedev/socks5
        container_name: socks5_test
        environment:
          - PROXY_USER=your_user
          - PROXY_PASSWORD=your_pass
        ports:
          - 1080:1080/tcp
        restart: always
    

  
Where:  
  
**container_name** : the name of your container;  
**PROXY_USER** : user;  
**PROXY_PASSWORD** : user password  
**1080:1080/tcp** : the port on which SOCKS will operate.  
  
Let's run the script (for this, you need to be in the directory where our file was created. In this case, it is **/home/socks5/**):
    
    
    docker-compose up -d 
    

  
Wait for the images to download and deploy.  
Let's check:
    
    
    docker-compose ps
    

  
or 
    
    
    docker ps
    

  
![How to install SOCKS5 in Docker - 5](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/11/01/1669744433_socks5.png)  
You can also do this with a single command without using **docker compose.**
    
    
    docker run -d -p 1080:1080 -e PROXY_USER=your_user -e PROXY_PASSWORD=your_pass -e PROXY_SERVER=0.0.0.0:1080 xkuma/socks5
    

  
Now for the connection, you can use the login and password with the port and IP of your server.   
  
To check and ensure everything is set up correctly, we can use the command below on another server:
    
    
    curl --socks5 your_user:your_pass@192.168.0.100:1080 https://ifconfig.io
    

  
If everything is set up correctly, we will receive the IP of the server where our SOCKS5 is hosted.  
  
  
For example, to connect SOCKS5 in Telegram, enter:  
  
**Server/Host** : IP:1080  
**User** : your_user  
**Password** : your_pass  
  
![How to install SOCKS5 in Docker - 6](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a48@server-panel.net/2022/11/01/1669744584_socks5_telegram.png)  
In browsers, Google Chrome or Firefox, you can use additional plugins to connect to this SOCKS5.  
  
Wishing you safe surfing.

Similar articles:

[Backups are not performed on the server with VestaCP](https://zomro.com/blog/faq/370-backups-are-not-performed-on-the-server-with-vestacp) [Disable UDP for RDP connections to Windows Server](https://zomro.com/blog/faq/429-dissable-udp-for-rdp-on-windows) [Performing backups of sites with rotation](https://zomro.com/blog/faq/354-performing-backups-of-sites-with-rotation) [How to create a site backup manually](https://zomro.com/blog/faq/206-kak-sozdat-bjekap-sajta-vruchnuju) [Connecting to the VPS server via SSH using a key](https://zomro.com/blog/faq/235-podkljuchenie-k-serveru-cherez-ssh-po-kljuchu-s-nestandartnym-portom)

[ Premium Cloud VPS from €7.95/mon ](/vps)
