Coder Social home page Coder Social logo

liberty's Introduction

Create Your Own VPN Server (SSR & V2Ray)

Prerequisites

  • Basic to intermediate knowledge of Linux.
  • Basic to intermediate knowledge of networking.
  • A Virtual Private Server (VPS) running preferably Ubuntu with Docker pre-installed.
  • If Docker is not already installed on your VPS, you must do it yourself.
  • Access to credit card or PayPal account or Bitcoin payment

Get a VPS

You need to get yourself a VPS as the first step. I can recommend the following providers:

  • OVHcloud
    • ๐Ÿ’ต Starting at โ‚ฌ3.5/month
    • ๐Ÿ“ค 100 Mbps unlimited outbound
  • PulseHeberg
    • ๐Ÿ’ต Starting at โ‚ฌ4/month
    • ๐Ÿ’ณ Accepts Bitcoin payments!
    • ๐Ÿ“ค 250 Mbps unlimited outbound
    • โœ… If you're a student, you can get a huge discount!
  • DigitalOcean
    • ๐Ÿ’ต Starting at $4/month
    • ๐Ÿ“ค Starting at 512 GB of free outbound transfer
    • โœ… If you're s student, you can get a $200 coupon via GitHub Student Developer Pack program valid for 1 year!
  • Vultr
    • ๐Ÿ’ต Starting at $6/month
    • ๐Ÿ“ค 2 TB of free outbound transfer.
  • Hostinger
    • ๐Ÿ’ต Starting at $3.5/month
    • ๐Ÿ’ณ Accepts Bitcoin payments!
    • ๐Ÿ“ค 1 TB of free outbound transfer.
    • โœ… If you're a student, you can get 10% discount!

Then, access your cloud server using a terminal. It is expected that you already know the how-to. So, I'm not going to go into details.

Method 1: ShadowsocksR (SSR)

Server

  • Pull the ShadowsocksR's Docker image using the following command:
docker pull alibo/shadowrocket-docker
  • Run the following command to create and run a container:
docker run -d --restart=always -e "SSR_PORT=1443" -e "SSR_PASSWORD=12345678" -e "SSR_METHOD=chacha20-ietf" -e "SSR_OBFS=http_post_compatible" -p 80:1443 -p 80:1443/udp alibo/shadowrocket-docker

โš ๏ธ Make sure to change the value of the field SSR_PASSWORD!

Client

Android

  • Download the APK file from here.
  • Install the app on your phone and open it.
  • Touch the "ShadowsocksR" at the top left. Then, touch the "+" sign at the bottom right corner and choose Manual Settings.
  • Now you need to manually enter the details. Here's a quick guide:
    • Group Name: Optional
    • Profile Name: Whatever you like
    • Server: The external IP address of your VPS
    • Remote Port: 80 (By default it is set to 8388. When you click on this number, the keyboard will pop up and you can enter 80 more easily.)
    • Local Port: 1080
    • Password: Your chosen password (same as SSR_PASSWORD)
    • Encrypt Method: chacha20-ietf
    • Protocol: auth_aes128_md5
    • Protocol Param: Leave empty
    • Obfs: http_post
    • Obfs Param: Leave empty
    • Route: All
    • UDP Forwarding: ON
    • Leave the remaining options in their default states.
  • All set! Now connect to the server using the paper rocket icon at the top right and check whether you can browse the internet.
  • Inside the app, touch the "ShadowsocksR" at the top left again. You must be able to see a "Share" icon in front of your profile name. Touch it and choose Copy URL.
  • This is the URL (starting with ssr://) that you should give out to your friends and family.
  • Now, you should try to prepare easy-to-follow instructions for the others to install the app and import the configuration. What they'll need to do is to copy the URL you got from the previous step, and import it into the app using the "+" sign. They'll have to choose Import from Clipboard.

iOS

  • Download the application from here. It's called Potatso Lite.
  • Open the app and click on Add a Proxy.
  • From the Manual Input section, click on Add.
  • Now you need to manually enter the details. Here's a quick guide:
    • Type: ShadowsocksR
    • Host: The external IP address of your VPS
    • Port: 80
    • Encryption: chacha20-ietf
    • Password: Your chosen password (same as SSR_PASSWORD)
    • Remark: Whatever name you like
    • Protocol: auth_aes128_md5
    • Protocol Param: Leave empty
    • Obfs: http_post
    • Obfs Param: Leave empty
  • All set! Click on Done. Now connect to the server using the "Play" icon at the bottom right and check whether you can browse the internet.
  • Inside the app, select Manage. Drag the profile from right to left and choose Share. Now select Copy URI to Clipboard.
  • This is the URI (starting with ssr://) that you should give out to your friends and family.
  • Now, you should try to prepare easy-to-follow instructions for the others to install the app and import the configuration. What they'll need to do is to copy the URI you got from the previous step, open the app, click on Add a Proxy, from the Auto Import section choose Proxy URI and paste the URI there.

Method 2: V2Ray

Server

  • Pull the V2Ray's Docker image using the following command:
docker pull teddysun/v2ray
  • Create a config.json file in the /etc/v2ray/directory with the following content. If the directory doesn't exist, make one.
{
  "dns": {
    "servers": [
      "1.1.1.1",
      "8.8.8.8"
    ]
  },
  "inbounds": [{
    "port": 8080,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "18d99b5a-9069-41c0-8d3f-65c03deb005d",
          "level": 1,
          "alterId": 0,
          "security": "chacha20-poly1305"
        }
      ]
    },
    "streamSettings": {
        "network": "tcp",
        "tcpSettings": {
          "header": {
            "type": "http",
            "response": {
              "version": "1.1",
              "status": "200",
              "reason": "OK",
              "headers": {
                "Content-Type": ["application/x-msdownload", "text/html", "application/xml"],
                "Transfer-Encoding": ["chunked"],
                "Connection": ["keep-alive"],
                "Pragma": "no-cache"
              }
            }
          }
        }
      }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  }]
}
  • Run the following command to create and run a container:
docker run -d -p 8080:8080 --name v2ray --restart=always -v /etc/v2ray:/etc/v2ray teddysun/v2ray

โš ๏ธ Make sure to change the id value under the client field! You can generate a random UID here.

Client

Android

  • Download the v2rayNG application from here.
  • Install the app on your phone and open it.
  • At the top right, click on the "+" sign and choose Type manually[Vmess].
  • Now you need to manually enter the details. Here's a quick guide:
    • Remarks: Whatever name you like
    • Address: The external IP address of your VPS
    • Port: 8080
    • id: Your chosen UID (same as uid under the field client in the server settings)
    • alterId: 0
    • Security: chacha20-poly1305
    • Transport: tcp
    • Head type: http
  • All set! Now connect to the server and check whether you can browse the internet.
  • Inside the app, you must be able to see a "Share" icon in front of your profile name. Touch it and choose Export to clipboard.
  • This is the URL (starting with vmess://) that you should give out to your friends and family.

Credits

Stargazers over time

Stargazers over time

liberty's People

Contributors

jacob-schmitt avatar mosnfar avatar

Stargazers

Armin Ariamajd avatar Ali Azmoodeh Valdi avatar Yamin Siahmargooei avatar Rasoul Veisi avatar shahab avatar MohammadSadegh Rategh avatar Majid Hajibaba avatar Ebi Soroush avatar  avatar Mamdasan Sabrian avatar  avatar Mohammadreza Haddad avatar Arash Nemat Zadeh avatar Mohammadreza Razavian avatar kavan avatar Mahdi Amrollahi avatar Amirali Kaboli avatar MOOOS avatar Ammar Salahi avatar Met avatar Farid Ahmadian avatar el.mo avatar Amir Kazemzade avatar  avatar Erfan Ghavam avatar @miratrix avatar arash orangpour avatar Mohamad Fadavi avatar Mohamad Khajavi avatar Mobin Larijanian avatar Mohammad Hoveida avatar  avatar Iliya avatar Nariman Esmaiely fard avatar  avatar Yasan avatar Farhad Uneci avatar Amirhossein Mahdinejad avatar Ali HK avatar Peyman Rashidi avatar  avatar Pooria avatar meysam213 avatar Mehdi avatar Hamidreza Safari avatar EzE avatar Alireza Azizi avatar  avatar Hashem Moghaddari avatar mojtaba avatar  avatar Jeff Habibi avatar Reza Parsian avatar mehran motiee avatar nima avatar Farzad Fattahi avatar AmirHosein Orojlo avatar Saman avatar  avatar  avatar Yoones Khoshghadam avatar  avatar Ali Maleki avatar Reza Sadeghzadeh avatar

Watchers

 avatar  avatar

liberty's Issues

V2Ray Linux/Windows client config

Hello! Thanks a lot for sharing the instructions, the V2Ray method works well on Android!
May I ask you to add a JSON client config for Linux/Windows as well? Thanks again <3

None of the methods working for me

I have tested both methods but none of them are working.
How can I solve it? I am using dg-occean.

By the way, is there any client for MacOS or Windows?

Is that the same as Outline?

Is that the same as Outline?
In spite of the fact that we can connect to our Outline server, Outline does not transfer any data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.