Publish Web Server in Ubuntu Linux

Estimated reading: 2 minutes 115 views

1. Install Web Server and Start Services on Ubuntu (Skip if not needed)

If you do not yet have or have not activated a web server, please follow these instructions to install and run a web server.

sudo apt update
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql

sudo systemctl enable apache2
sudo systemctl start apache2

sudo systemctl enable mysql
sudo systemctl start mysql

Access Your Website Locally: http://localhost

*Make sure you are able to access your web server locally

2. Add VPN Account

  • Select the IP Public Full Port menu.
  • In the IP List, click Actions then click View
  • Add a new account by selecting the VPN Account tab, then clicking Add VPN Account.

  • Enter your desired username and password, then click Save.

  • The new VPN account has been successfully created.

3. Add Access Port

  • Add a port access by clicking the Access Port tab, then selecting Add Access Port.

  • Choose either the TCP or UDP port, then select Local Port 80 and Public Port 80. Also, choose the VPN account to which port 80 will be forwarded, and click Save.

  • Also add an Access Port for TCP 443.

4. Connecting VPN Account

We recommend using WireGuard on Ubuntu to connect to your VPN account:

  • Install WireGuard:
WireGuard Installation Guide for Linux
  • Create a WireGuard config file:
sudo nano /etc/wireguard/wg0.conf
  • Copy Wireguard config script

Copy wireguard configuration.

WireGuard configuration example

Paste your copied configuration inside this file, then press Ctrl + O to save and Ctrl + X to exit.

WireGuard configuration example
  • Start the VPN connection and enable auto start:
sudo wg-quick up wg0 && sudo systemctl enable wg-quick@wg0

5. Access Web Server using Public IP

  • Find IP Public in Overview Tab (example Public IP is 11.12.13.14) click copy icon to copy Public IP
  • Open browser then paste Public IP to open web.

Leave a Comment

Share this Doc

Publish Web Server in Ubuntu Linux

Or copy link

CONTENTS