How can setup a remote ssh server for exposing my local website to the internet using my domain on aws by tunneling?

Like: By using serveo.net that can be done by running following command on my local machine:

ssh -R abc:80:localhost:80 serveo.net

then I can open my website using abc.serveo.net

I want to do the same for my aws website:mydomain.com then after running the following command on my local machine

ssh -R abc:80:localhost:80 mydomain.com(or anything similar)

I can access Apache on my local machine from abc.mydomain.com

(My isp didn't gave me a static ip and no port are open for internet connection on my local machine)

  • Your ISP did this on purpose. You cannot use a residential ISP account for business purposes. Try FTP'ing your local site to your AWS cloud...
    – eyoung100
    Nov 17, 2018 at 4:28

2 Answers 2


I don't know why you want to be able to access the pages by domain name after sshing to the server, but here is how to access a web service like apache, phpmyadmin or mysql over ssh.

You need to setup a dyndns or noip account or similar. Once you have a set domain name, set portforwarding on your router to send the ssh port to the computer you want to ssh into. Then you would ssh -R 80:localhost:8080 [email protected] then set your browser to use SOCKS proxy and set the address to and port to 8080. Browse to or the ip address of the webserver on your home network most often 192.168.1.* and that should do it.

  • Thanks a lot.I wanted to access apache2.
    – user321420
    Nov 17, 2018 at 12:29
  • You're Welcome! @Amiy Nov 22, 2018 at 16:38
ssh -L 6001:localhost:9200 root@server_ip
  • 6001 - is local port
  • 9200 - server port

You must log in to answer this question.