WebServer Hosted at Home Easily

This is the procedure to self-host a WebServer on a HomeLab network. This assumes that the user has no hosted services and that this is the first attempt at hosting. The section for NginX Proxy Manager installation can be skipped if you already have a reverse proxy installation.

You need a domain name which is as little as $12 a year through Google, Cloudflare and others. In my tutorial, I use Google DNS as my domain name provider.

You need to define a CNAME record for your webserver subdomain name and an NPM record to access your webserver using that domain name and that’s what we discuss.

Create a Dynamic DNS name for your domain name at your Domain Name Provider website.

Install a dynamic dns client on your Ubuntu or Raspberry Pi server:

sudo apt install ddclient

After installation, edit the ddclient.conf file:

sudo nano /etc/ddclient.conf

Insert the following code:

# /etc/ddclient.conf
password='generated_password' # this MUST be in quotes

Change your credentials and domain name above as described in the video.

Test your configuration:

sudo ddclient -daemon=0 -debug -verbose -noquiet

Install docker and docker-compose:

sudo apt install curl
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker your-username
newgrp docker
sudo apt install docker-compose

Create a docker folder in your home folder of your server and associated folders:

mkdir docker
cd docker
mkdir npm
cd npm

Create a docker-compose file for NPM:

nano docker-compose.yml

Insert the following code:

version: '3'
    image: jlesage/nginx-proxy-manager
      - "8181:8181"
      - "8080:8080"
      - "4443:4443"
      - "./config:/config:rw"

Start NPM:

docker-compose up -d

Go to your server address at port 8181 to configure NPM, In my case this is
The initial username is admin@example.com and the initial password is change, Follow the video and update these.

Go back to the docker folder and create a wordpress folder and associated folders:

cd ..
mkdir wordpress
cd wordpress
mkdir database
mkdir html

Create a docker-compose file for WordPress

nano docker-compose.yml

Insert the following code:

version: "3.3"
    image: mysql:5.7
      - ./database:/var/lib/mysql
    restart: always
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
      - db
    image: wordpress:latest
      - ./html:/var/www/html
      - "80:80"
    restart: always
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
  db_data: {}
  wordpress_data: {}

Change the passwords and port number as indicated in the video. Then start the installation:

docker-compose up -d

Visit your website at your server address and port number you specified above to continue configuration.

After configuration, visit your NPM web page and add a proxy for your www.mydomain.com to point to the address and port number of your webserver. Note that www.mydomain.com must already be defined as a CNAME record at your DNS provider pointing to your domain name.

Finally, test your new proxy by going to https://www.mydomain.com in your web browser and it should go to your website page with SSL.

Hi Scott. Just found our youtube channel today and I have to say it is great! Helps me quite a bit setting up my own LXD servers for different services and home automatition etc. on my qnap NAS.
I have just one question about this tutorial: if I understood correctly, you are saying to create a separate DNS record in the dynamic DNS service for each sub-domain. What is the advantage of this? I have just one record in my dynamic DNS service, hence all requests for all subdomains are routed to my reverse proxy which then forwards the requests to the according virtual server based on the requested subdomain.

You will want to just create a single dynamic dns record for your domain name. As an example, I have a dynamic DNS A record for scottibyte.com. I then have a CNAME record for each hosted service. For example, this forum has a CNAME record for discussion.scottibyte.com that points to scottibyte.com.

Although it sounds a bit redundant, I have about 40 CNAME records that point all point to scottibyte.com. Reverse proxy is what handles knowing what services route to which internal server.

Thanks for the kudos!

Ok, CNAME is the correct name. But again, what is the advantage of CNAMEs for each sub-domain?
I don’t have them and have my reverse proxy separating the different requests based on called sub-domain. Works without any issue.

Ahh, ok. So the advantage of CNAME records is they are just aliases to your domain name record which you will want to define as a dynamic DNS A Record. I know that sounds weird because it means that all the CNAME records translate to the same address, which is true. That’s because your ISP provides your router with ONE DHCP WAN address,

So, effectively in my case https://www.scottibyte.com, https://discussion.scottibyte.com, and https://chat.scottibyte.com all end up pointing to my domain name dynamic DNS A record for scottibyte.com which means they all have the same address. Reverse proxy (NginX Proxy Manager) handles routing each of the names to the proper system inside of my private network.

If you did not have CNAME records, you would need to have a dynamic DNS A record for each and every subdomain name that pointed to a dotted IPv4 address since your ISP WAN address can change. That would mean an A record for https://www.scottibyte.com pointing to, an A record for https://discussion.scottibyte.com pointing to and an A record for https://chat.scottibyte.com pointing to The CNAME record requires only that it points back to the domain, so it is a shorthand.

This is a valuable information on self-host a WebServer on a HomeLab network. And also thanks for sharing all steps to proxy installation. Here you find information on dynamic IP. Thanks

1 Like