How to Setup a Web Server on IPv6 VPS

Posted on

IPv6 is always challenging but fun, our main purpose is to setup a web server where both IPv4 and IPv6 will be able to access it.

  1. If you dont have a VPS yet, you can create a free ipv6 VPS on,  this is my free VPS from hax:
  2. Check this tutorial for how to connect to ipv6 vps
  3. Pointing a domain to Cloudflare using AAAA record, if you dont have a domain lets grab a free sub domain at Fill in the sub domain and ipv6 address

  4. Login to your VPS and run the following command to allow 80 and 443 (if firewall active) and install a web server
    Ubuntu 20.04

    apt update -y
    --below is optional--
    ufw allow ssh
    ufw allow 80
    ufw allow 443
    ufw enable
    apt install apache2 -y
    apt install php7.4 php7.4-mysql php-common php7.4-cli php7.4-json php7.4-common php7.4-opcache libapache2-mod-php7.4 -y
    apt install mariadb-server mariadb-client -y
    systemctl restart apache2
    systemctl enable apache2
    systemctl enable mariadb

    Centos 8

    yum update -y
    yum install httpd -y
    systemctl enable httpd
    systemctl start httpd
    firewall-cmd --permanent --zone=public --add-service=http
    firewall-cmd --permanent --zone=public --add-service=https
    firewall-cmd --reload
    yum install -y php php-mysqlnd
    yum install mariadb-server mariadb -y
    systemctl enable mariadb
    systemctl start mariadb
    systemctl restart httpd

    Debian 10

    sudo apt update -y
    sudo -- sh -c 'apt update && apt upgrade' 
    sudo apt install apache2
    sudo ufw allow www
    sudo ufw allow https
    sudo ufw allow in "WWW Full"
    sudo apt install php libapache2-mod-php php-gd php-mysql
    sudo apt install mariadb-server
    sudo mysql_secure_installation
    sudo systemctl restart apache2.service

  5.  You can visit your domain / sub domain (step3), for example  and see an example page there
See also  How do I connect to IPv6 Server?