Your servers reverse proxy (Caddy, Traefik, Apache, Nginx...) redirects incoming requests to your application (Wordpress). You need to configure the reverse proxy so that it knows which request (origin / the subdomain) to forward to which destination on the server.
Self-Hosted Main
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
For Example
- Service: Dropbox - Alternative: Nextcloud
- Service: Google Reader - Alternative: Tiny Tiny RSS
- Service: Blogger - Alternative: WordPress
We welcome posts that include suggestions for good self-hosted alternatives to popular online services, how they are better, or how they give back control of your data. Also include hints and tips for less technical readers.
Useful Lists
- Awesome-Selfhosted List of Software
- Awesome-Sysadmin List of Software
If your DNS record points to your server IP that's all it needs from the DNS perspective. Now, your server needs to map those requests to your WordPress website. That's handled by Apache or Nginx, or whatever other server you may be using.
I've sysadmined wordpress for about 7 years professionally, so this stuff is as easy as making cereal to me. But there is a few steps. On a high level:
- Subdomain must point to your public IP
- Your public IP probably changes sometimes so you should have a way to automate updating the IP for your home server via the DNS provider's API
- Your router must be forwarding port 80 and 443 to your server
- Your server needs a web server software that can take the request and map it to the right virtual host for your site (and you need to make said virtual host)
- The wordpress install needs to have used wp-cli or a wp-config.php hack to change the domain of the site that wordpress thinks it is running as
- You need to secure the domain with letsencrypt, certbot will do this for you
This is the steps for a traditional web server, but since we usually use docker around these parts, instead of the normal web server software (apache or nginx) the way to use in docker is "letsencrypt nginx proxy companion" which will route an incoming connection to the docker container running wordpress and handle letsencrypt for you.
There are also a few other ways one might commonly set this all up, and what steps you are missing depends on the way you are hosting wordpress right now.
If you fill in some of the missing information on what you do or dont have from the steps above, I'll let you know what's next. Or you can send me a PM on reddit and I'll help you out!