How to Install OpenVPN on Ubuntu (self-hosted VPN)

Поделиться
HTML-код
  • Опубликовано: 8 янв 2025

Комментарии •

  • @saadh2564
    @saadh2564 3 года назад +192

    Sent Tony an email like 2 days ago regarding this specific question and literally 2 days later this man comes out with the perfect tutorial! Appreciate your help so much dude!!

    • @TonyTeachesTech
      @TonyTeachesTech  3 года назад +21

      Happy to help you out!

    • @thebusinesscentre
      @thebusinesscentre Год назад +2

      @@TonyTeachesTech I have not mailed tony yet. But that man has helped me more than anyone. And I wish to thank him for his help! ❤

    • @tabbytobias2167
      @tabbytobias2167 Год назад

      @@TonyTeachesTech you are awesome, you have basically every tutorial on every piece of tech.

    • @CoachGarcia
      @CoachGarcia Год назад

      Where did you found his email I am trying to contact him thanks

    • @KyraTheFloof
      @KyraTheFloof 11 месяцев назад

      Yo thank you so much for making this shit, saved my ass so much money.@@TonyTeachesTech

  • @erichart2072
    @erichart2072 Год назад +3

    Dude, I've been trying to configure one of these for years on an old vps. Every guide I found was crap. This was perfection, had it all up and running in about 30 mins. Thank you!!!!!!!

  • @paulhaubourdin6234
    @paulhaubourdin6234 Год назад +25

    Things have changed a bit: first off when adding the repositories you have to change the name of the ubuntu version you're using (in my case I changed "focal" to "jammy", also the default password for the openvpn (admin) user is given in the terminal when finished installing (so you cannot use "passwd openvpn" command anymore).

  • @reachmind.411
    @reachmind.411 3 года назад +7

    I really owe you one dude. After hours trying by other guys yours worked ! You won a new subscriber.

  • @abdinasirmoalin2849
    @abdinasirmoalin2849 2 года назад +7

    Thank you very much. Your explanation made it so simple. I watched others a lot. Luckily I found your when I had to give up. The way you showed was even easier and effictive teaching than the ready-made templates. Thank you again

  • @Stev.3n
    @Stev.3n 2 года назад +5

    Awesome guide. Was going to use the OVA template from them, but this worked out much better to setup it and run my unifi controller on the same server.

  • @Mikeb8134
    @Mikeb8134 2 года назад +1

    Thanks!

  • @ilona7051
    @ilona7051 Год назад +3

    Don't forget to run as superuser (root), or use 'sudo' before every 'apt' command. You can change to superuser/root mode by running 'sudo su -' in the command line.

  • @snowysysadmin59
    @snowysysadmin59 2 года назад +9

    Short, sweet and to the point. SIMPLE

  • @-Vishal-of3he
    @-Vishal-of3he 4 месяца назад

    The only guide thats actually beginner friendly

  • @anakinskywalker6728
    @anakinskywalker6728 Год назад +1

    very much THANK you!
    i spent two day reading forums, and couldn't look find a good solution.
    i'm just learning linux system

  • @thmgarnier
    @thmgarnier Год назад +8

    Hey Tony, i am getting this error when installing openvpn-as:
    The following packages have unmet dependencies:
    openvpn-as : Depends: libssl1.1 (>= 1.1.1) but it is not installable
    E: Unable to correct problems, you have held broken packages.

    • @CoachGarcia
      @CoachGarcia Год назад +1

      Unfortunately I am having the same problems I see after 6 months you got no reply

    • @jokkmokk6238
      @jokkmokk6238 Год назад

      you aswell
      @@CoachGarcia

    • @MT-xn4mb
      @MT-xn4mb 3 месяца назад

      check if you are using the 20.04 version of ubuntu , i was using the 22.0 version and it didnt worked, but i updated and it did

  • @hallercory
    @hallercory 2 года назад +5

    Man. I really appreciate your tutorial. Learned a lot and it makes managing my plex server so much easier.

  • @josiahv92
    @josiahv92 Год назад +1

    Great video! Bold to share your IP like that, but I like bold 👍

  • @splitee
    @splitee 3 года назад +4

    yo, this was a great video, very easy to follow along. Thanks! subbed btw

  • @alexismc1111
    @alexismc1111 4 месяца назад +9

    if you get this error: "Depends: libssl1.1 (>= 1.1.1) but it is not installable".... change the name "focal" to the name of your ubuntu version

    • @LadyMaria-c2e
      @LadyMaria-c2e 3 месяца назад +2

      My fucking xhai! Fixed it by replacing focal with noble (noble is ubuntu 24.04). Easy ass fix.

  • @khalidelgazzar
    @khalidelgazzar 2 года назад

    Great Video. Thanks Tony😊👍

  • @TK-rr1gj
    @TK-rr1gj 3 года назад +1

    Brilliant content straight to the point, lean bacon! Love it!🤓

  • @JoseRodriguez-os3qv
    @JoseRodriguez-os3qv 3 года назад +2

    amazing Tony your videos are great appreciate you

    • @TonyTeachesTech
      @TonyTeachesTech  3 года назад

      Thank you very much

    • @coding3617
      @coding3617 Год назад +1

      @@TonyTeachesTech it is using my private ip address so i cant access it how can i fix it?

  • @jyudat4433
    @jyudat4433 Год назад

    thanks for this ! did this right after Canadian bill c-11 (censorship) passed on my American vps

  • @metamototomo
    @metamototomo 2 года назад

    Amazing! Thanks, Tony

  • @DanielWise-h5k
    @DanielWise-h5k 23 дня назад +3

    thank you, but this is a very difficult way. I just installed hide expert vpn and everything works)

  • @elements88xyz
    @elements88xyz Год назад

    Thank you for this. Much appreciated.

  • @WassimBM
    @WassimBM 2 года назад +1

    Thank you Tony, that was useful and very clear :)

  • @wuliuxiansheng1605
    @wuliuxiansheng1605 Год назад

    I really exited that it worked when I followed what you did

  • @dirac7233
    @dirac7233 11 месяцев назад

    Very useful. Thanks 👍🏽.

  • @mortezarostami3287
    @mortezarostami3287 2 года назад

    thanks man, it was great :)

  • @nurferdi8994
    @nurferdi8994 2 года назад +2

    hi can u help me i use Ubuntu 18.04 i want to install open vpn-as in putty and then it says unable to correct problems, you have held broken package , what should i do ?

  • @it-expat-china
    @it-expat-china 2 года назад +2

    Thanks Tony for this great tutorial which I followed through and successfully creatd my OpenVPN access server.
    I just want to mentiona that as of writing this comment, it seems that this access server setup doesn't generate a user account "openvpn" anymore. Instead you are getting a new "openvpn_as" user on the Ubuntu system. Also, you'll have to open up port 943 (tcp) for the admin portal to be accessible through web browser.
    In addition, port 443/tcp and port 1194/udp will be used by open VPN service itself for client to connect. Hence above mentioned ports shall be open on the Ubuntu ufw and relevant security rules from the cloud hosting service provider.

    • @derfinlay5854
      @derfinlay5854 2 года назад +2

      hi, i changed the openvpn_as user password but the web GUI says the credentials are invalid, any suggestions? Thank you.

    • @rogedgames
      @rogedgames 2 года назад +1

      @@derfinlay5854 any fix?

    • @derfinlay5854
      @derfinlay5854 2 года назад +1

      @@rogedgames yes. Run sudo ovpn-init

    • @biggiantcookie
      @biggiantcookie 2 года назад +2

      @@derfinlay5854 This was the solution I was looking for, Thank you!!!

    • @derfinlay5854
      @derfinlay5854 2 года назад

      @@biggiantcookie sure

  • @ecmthr
    @ecmthr Год назад +2

    Hi Tony,
    I have "Ubuntu 22.04.2 LTS" and I got this error on installation time:
    The following packages have unmet dependencies:
    openvpn-as : Depends: libssl1.1 (>= 1.1.1) but it is not installable
    E: Unable to correct problems, you have held broken packages.

    • @iury4527
      @iury4527 Год назад +1

      same here

    • @kiril135790
      @kiril135790 Год назад +1

      same

    • @心蕊-n7q
      @心蕊-n7q Год назад

      @@kiril135790 use ubuntu 20 and 22 version have this error

  • @JustLikeHammer
    @JustLikeHammer 2 года назад +2

    Thanks to your tutorial I do managed to setup my own VPN. It was pretty hard for me because I'm totally new to linux. Whatever Thank you man!

  • @PreetBinning
    @PreetBinning 2 года назад

    Great Video. Thanks!

  • @nghia9628
    @nghia9628 9 месяцев назад +2

    This probably a dumb question: But if i host an Ubuntu server at home as Access server using Openvpn, do i need to config the router (such as Enable VPN or Forward port) so i can ssh to the server remotely?

    • @thegerman1239
      @thegerman1239 7 месяцев назад +2

      No you need a reverse proxy to access it from the outside. I recommend Apache, but it might take you a while to configure it right. Good Luck if you are still intersted! :)

    • @nghia9628
      @nghia9628 7 месяцев назад +1

      @@thegerman1239 Thank u for the answer, after make some searching I decided to go for the Tailscale and got exactly what I need without any complicated configuration:))

  • @thayaganthusiyanthan9708
    @thayaganthusiyanthan9708 3 года назад

    This great and I like your other videos to I just subbed

  • @Lebyy
    @Lebyy Год назад +2

    After running apt install openvpn-as it doesnt show me a link after installing

  • @TheRuslanChanel
    @TheRuslanChanel Год назад

    Thanks, man! You helped me a lot

  • @simonriley8696
    @simonriley8696 3 месяца назад

    Just a quick question.Can i use this to access the rds in the private subnet ?

  • @rayoseldev819
    @rayoseldev819 Год назад

    min 3:22 apeear private ip not public :S where can i change it? :S

  • @emilstomehoff4465
    @emilstomehoff4465 10 месяцев назад

    Hi, Tony can you make the same tutorial with the OpenVPN community edition where we have no limitation of the connections(licenses). Thank you

  • @ikraa2000
    @ikraa2000 Месяц назад

    I'm trying to connect to Debian server from a Centos client. Once I enter the credential to connect, it's not as straight forward like the Mac. It's asking for more configuration. Is there a configuration file I should use and if yes, what command should I invoke? Thanks

  • @maomao6679
    @maomao6679 5 месяцев назад

    Hi, thanks for the tutorial, so for this one you do not need port forwarding? Openvpn does all? Or you still need to setup the port on the router?

    • @xsolaris42
      @xsolaris42 4 месяца назад

      They're using a VPS. If you're using your own server, you'll need to take care of the routing/networking bit as well in order to be able to access it remotely

  • @DeepThakkar
    @DeepThakkar 2 года назад +1

    Hi @Tony,
    I installed OpenVPN on Ubuntu Server, hosted on Oracle Cloud.
    I am able to connect to the OpenVPN using client from a windows PC, but after getting connected to the VPN, internet is not working. Please help.

  • @ahmedu921
    @ahmedu921 2 года назад

    Hi Tony , Please can you do a video about how to automate the openVpn installation using Ansible playbook

  • @make10000
    @make10000 3 года назад +5

    can you make a tutorial similar to this but for WireGuard

  • @genobisceglia5629
    @genobisceglia5629 2 года назад

    Great video!

  • @alanhiggins2521
    @alanhiggins2521 3 года назад +1

    This is my first Ubuntu server/ OpenVPN set up. I have typically used the built VPN service built into my home router however i decided to build my own VPN server to access my resources at home. This video appears to be what i need to accomplish this task however since it's my first attempt, do you have a video that goes over the steps/configuration to access my LAN resources with security in mind.

  • @Erick101271
    @Erick101271 2 года назад +1

    Hi, I tried to setup the same as you discussed. But Im not getting internet when I turn-on the client app.
    I actually used Virtual Machine using Virtual box to setup the OpenVPN server
    ? Is this might be the issue?

  • @jjbesp
    @jjbesp 2 года назад +2

    Great video but I'm having some trouble getting it to work on a virtualbox VM running on my home PC. I'm using the virtual appliance provided by openvpn on their website and set it up using all defaults, but it uses the private ip. When I switch to my public ip in the access server I can no longer connect nor import profile :(

  • @gorazdnovsak3705
    @gorazdnovsak3705 2 года назад +1

    I attempted to ask on your webpage but it looks like reCaptcha is broken. Is this also limited to 2 users as is image on OpenVPN page or is unlimited users?

  • @mdatiqmazumder
    @mdatiqmazumder Год назад

    Awesome Brother..give me a suggestion or a video how can i forword my port using openvpn hosted on my vps..please

  • @ice_ryda
    @ice_ryda Год назад

    Thanks triple T. 💪🏿

  • @jonaskofoed1470
    @jonaskofoed1470 2 года назад +1

    Hi Tony. Do you know how to set it up for Remote access?

  • @RoyHess666
    @RoyHess666 2 года назад +1

    found this tutorial, since I've ever managed openvpn via command line only so far.
    Installed openvpn-as on a freshly installed testing vm on ubuntu 20 but I cannot for the sake access the admin panel, it shows eula to accept, but sends me right back to the login screen.. what a brilliant piece of software this is.
    username and password are correct, accessing it from different browsers, still the same.

  • @endeshaw1000
    @endeshaw1000 8 месяцев назад +1

    I cannot install the dependency libssl1.1 as it was removed from the ubuntu repository due security concerns - Maybe because of the recently poped up xz-CVE? Do already a workaround for this exists?

  • @ethangender
    @ethangender 2 дня назад

    my problem with this is that access server is paid i want to manage my vpn completely opensource allowing me to have multiple users

  • @atharvmukane4768
    @atharvmukane4768 Год назад +1

    I have forgot my openvpn access server admin password. Plus, when I try "passwd openvpn", It says "passwd: user 'openvpn' does not exist".
    Please help me solve this.
    Thankyou.

  • @speedtnt7591
    @speedtnt7591 2 года назад

    Thanks for this amazing tutorial.
    how can we set it up on two vps? one inside the country and the other one in a country that we want our IP get changed?
    and how can we change the port?

  • @HisLoveArmy
    @HisLoveArmy Год назад

    Do you have any videos showing how to limit users to say just 1 server on the network?

  • @siddharthsharma871
    @siddharthsharma871 7 месяцев назад

    when you login into the openvpn UI , we saw there was line which was saying only 2 vpn connection allowed. so if wanna setup this openvpn server for my 50 member of team member. will this setup work or we have to purchase the Paid plan?

  • @vineetsharma5233
    @vineetsharma5233 5 месяцев назад

    Thanks @tony😊😊

  • @quanghuypham5789
    @quanghuypham5789 Год назад

    Can I use these installation steps in Ubuntu 22.04.2 LTS ?

  • @rayreyes3922
    @rayreyes3922 2 года назад +2

    Thank you so much for taking the time to teach us. I have a question, why is it that it grabs my private IP instead of the public IP?

    • @mhaggagegy
      @mhaggagegy Год назад

      I have faced the same problem. I couldn't find a solution.

    • @coding3617
      @coding3617 Год назад

      @Tony Please help

  • @HuDz1966
    @HuDz1966 Год назад

    With the VPN active is all data passed through the VPN now encrypted?

  • @exact-itacademy1282
    @exact-itacademy1282 2 года назад

    Hi Tony, can you restrict access to your webserver only to pc connected to vpn server ?

  • @JPabloDonayreQuintana
    @JPabloDonayreQuintana Год назад

    How to use VPN for sharing critical data of my company ?
    I mean, how to setup my company website in order to access only if im using a specific VPN ?

  • @ignasi_8310
    @ignasi_8310 2 года назад +2

    Can u help me i have a problem when i install openvpn i can acces to the login page but when i type the command openvpn passwd it says that the use doesn't exist

    • @ignasi_8310
      @ignasi_8310 2 года назад +1

      i have got the solution just getting to the directory /usr/local/openvpn_as/scripts/ and using command ./sacli --user openvpn --new_pass 123 SetLocalPassword

    • @TonyTeachesTech
      @TonyTeachesTech  2 года назад

      Happy you figured it out

  • @حذيفةفرح-س6ي
    @حذيفةفرح-س6ي 3 года назад

    Thanks you, clear and easy explanation

  • @c.m.7037
    @c.m.7037 2 года назад

    Dont you need to implement policy and routing on the server? Like what you are allowed to access etc.

  • @othmankial
    @othmankial 7 месяцев назад

    hello, thanks for the video, i wanna ask where I can find that address that u inserted after @ thanks in advance

  • @jaydentechvids2620
    @jaydentechvids2620 Год назад

    Thank you for the video! Do you know how to set up the vpn server to not change the ip? I want to access my linux server outside my network. For example, I want to access samba server, cockpit, and home assistant outside the network.

  • @ysfkyya
    @ysfkyya 2 года назад

    Thanks for the video. i have a question: i did the installation steps and when i clicked the link, This site can’t be reached. What is the reason for this error? what should I do?

  • @montala3380
    @montala3380 2 года назад

    Hi, how to install SSL for openvpn access server? by default, the connect to admin and client UI is not secured

  • @boldbuzz
    @boldbuzz 2 года назад +1

    Thanks for the Tut, but I'm having issues connecting. For some reasons unknown to me, after running the OpenVPN installer, the IP always default to my ubuntu private IP instead of the public IP, and it doesn't open the OpenVPN admin page with the private IP but when I put the public IP, it opens the admin UI. Same thing is happening on the OpenVPN client, the IP is also default to the private IP. Is this normal? Is the IP supposed to be the private IP? If yes, why then does it refused connection. I have tried this using Oracle Cloud always free tier and also tried this on Amazon AWS. Both having same issues. Please your assistance is appreciated. Sorry for the long note 😊

    • @TonyTeachesTech
      @TonyTeachesTech  2 года назад

      OpenVPN should be using your public IP. That is the normal behavior. Any update on your end?

    • @boldbuzz
      @boldbuzz 2 года назад

      @@TonyTeachesTech It still refuse to connect on the client app. But on AWS, I had to go through their app section then install it through there and it doesn't default to the private IP on the client side which allows it to connect. Anyways thanks alot for your tutorials.

  • @afshaarahmed2114
    @afshaarahmed2114 Год назад

    if i want to access some specific domain through OpenVPN then?

  • @homatv3709
    @homatv3709 3 года назад +1

    Hi Tony thanks for simplified and Nice tutorial, Can we have a tutorial for OPVPN open source one that can be accessed through internet. I have configured one but I can only access on Local Network.

    • @TonyTeachesTech
      @TonyTeachesTech  3 года назад

      I can add this to my list of video ideas

    • @angrynorseman5566
      @angrynorseman5566 2 года назад

      It would be great if this one was named correctly to reduce confusion like so many other versions of these videos. Everyone that demos the install of openvpn-as seems to just hijak the original project name vs using correct applications name.

    • @hpksingh3067
      @hpksingh3067 2 года назад

      did you find any guide? i am looking to access openvpn server through internet like openvpn server is setup to another location on a linux system and i am not able to connect to it :(

  • @rafiekalibuxful
    @rafiekalibuxful 2 года назад

    Thanks, I just succesfully installed openvpn on ubuntu server 22.04.
    Can you explain how to create the config file .ovpn, which we can use for android devices.
    I want to connect to my vpn server at home from outside.
    tnx

  • @CoachGarcia
    @CoachGarcia Год назад

    How come you didnt need to port foward port 1194 to be able connect on your open vpn ? Usually u need to do this

  • @L3gion3r
    @L3gion3r Год назад +1

    I get an error at the wget line "apt-key is deprecated". E: this command can only be used by root. Also, I get Access denied at the echo "deb..." line as well

    • @asce313
      @asce313 Год назад +1

      same for me as well, did you find a solution?

    • @Partaz
      @Partaz Год назад

      same, not sure what to do

  • @codemind1822
    @codemind1822 2 года назад +2

    Thanks Tony I did it. For newer versions you don't set a password. Also in my server passwd openvpn does not work it says openvpn user does not exist in my linux.
    Nowadays passwords are created automatically by the server. Once you set it up, server assigns a password. If you happen to miss it, to recover that password, simply type
    cat /usr/local/openvpn_as/init.log
    This will give your login password like
    To login please use the "openvpn" account with "somPass-SLDJKSLFj235" password

  • @Neutral621
    @Neutral621 2 года назад

    Hi Tony, I'd like to configure the "ovpn" file from the user access area for a Linksys WRT54G router running Fresh Tomato. I've been on it unsuccessfully for hours. Any idea how to do that?

  • @Mikeb8134
    @Mikeb8134 2 года назад

    Thanks for the info. I like to make puzzle and solve them. Could I use this to tunnel my connection through to another location? Say I had a computer that had it's own VPN where I wasn't the admin and thus couldn't change anything on the computer like add software or anything but I wanted the computer to think it was in a certain location before I logged into its VPN. Are there any guides that explain how to do this? Thank you!

    • @TonyTeachesTech
      @TonyTeachesTech  2 года назад +1

      If you're able to connect that computer (where you weren't the admin) to your self-hosted VPN, then external connections will appear as if they are from the location of the VPN server. No guide for this, but assuming you can make the connection, you'll be golden

  • @fahimshafahi4388
    @fahimshafahi4388 2 года назад

    my iphone can not connect to the VPN-Server when i am out of the network. how can i fix it. how to connect to my home vpn server from another network?
    thank you.

  • @BlueDolphinBlues
    @BlueDolphinBlues 7 месяцев назад

    Do a video on installing open VPN without access server

  • @Shredzter
    @Shredzter 2 года назад

    Can I do this with Kali or is this Ubuntu exclusive?

  • @manibarma9478
    @manibarma9478 2 года назад

    After got url to access openvpn on browser it's not opening for me, ll traffic is opened , can you suggest here ?

  • @MattDanner3
    @MattDanner3 2 года назад +3

    Run "ovpn-init" if you are having issues with the username / password.

  • @aimn19861
    @aimn19861 2 года назад

    When you connect to your openvpn server can you access local ip addresses inside LAN?

  • @CloudGirl
    @CloudGirl 2 года назад

    I try install on my VDS - Ubuntu but.. I have failure message: This page is not working, web has not sent any data. When i try login to admin

  • @pwchan7443
    @pwchan7443 3 года назад +1

    how about OpenVPN Community edition? cuz i dont see so much about it from google or youtube. most likely openvpn AS edition only(like what u did in the video)

  • @HisLoveArmy
    @HisLoveArmy 10 месяцев назад

    So my self hosted box is not working. On my client i get the error "peer certificate verification failure" I even removed my cert and added a new one and it is still not working.

  • @atharvmukane4768
    @atharvmukane4768 Год назад

    My VPN profile is stuck on loading when trying to connect and after a while says connection timed out. Dont know what I did wrong. Please help.

  • @jacobanderson9530
    @jacobanderson9530 2 года назад +4

    Great video! :) Just to let you know "apt-key add -" does not work on ubuntu 22.04

    • @DeadVoidzzz999
      @DeadVoidzzz999 2 года назад

      yeh thats where i ran into some issues too lol

  • @vikrammalkan4695
    @vikrammalkan4695 6 месяцев назад

    I love your video.

  • @k0u0s0h0a0g0r0a0
    @k0u0s0h0a0g0r0a0 2 года назад

    Good tutorial. Works for windows and macbook, but clicking on ubuntu redirects to some article, instead of downloading settings.

  • @hamon3533
    @hamon3533 2 года назад

    Thank you so much i just started my vpn server. How can i restart the server without reinstalling?

  • @Dean-rs2nt
    @Dean-rs2nt 4 месяца назад

    This is good from a local / lab point of view, but this is no good as a means to connect to you network from somewhere else... What you have implies a static ip address.. but most vpn setups such as this will require a DDNS setup in order to connect a vpn

  • @m1schief10
    @m1schief10 2 года назад

    great video , but when I want to add oepnvpn to my repository list , it won't work , I get an error " Try `wget -- help for more option " , I triple check it , I'll do everything as you say .

  • @farshadtalebi1849
    @farshadtalebi1849 2 года назад

    thank mr Tony.I have problem can you help me?

  • @adrianpadilla1425
    @adrianpadilla1425 2 года назад

    *correction post edit ...thank you for this tutorial I have it installed and working but one thing I need help with..when I connect to my network via vpn I can not see any printers on my connected network....any hep would be greatly appreciated

  • @tmati7860
    @tmati7860 Год назад

    I did everything stpe by step and when I'm going to reach the admin page or even my IP address with 943 port, the page doesn't load and I get this message from browser: "This site can’t be reached"