Click On Tyler Support


Contact Us

Support Home » VirtualHostX » Getting Started

Hosting a Live / Production Website with VirtualHostX

Last Updated December 17, 2019

When VirtualHostX first launched in 2007, the app's primary purpose was to help web developers and designers test their websites locally on their Mac. But with the demise of macOS Server's feature-set in recent years, lots and lots of folks are looking for a new, simple way to run websites on Mac - including many of VHX's customers. I've replied to lots of emails on the topic over the years, but this FAQ contains all the best practices I recommend.

If you're new to VirtualHostX, the first thing you'll want to do is get the app installed and create your first website. We have an illustrated Getting Started guide available here.

Once you've verified that your website is working locally for you on your Mac, you'll want to follow these steps to configure it and allow access from the internet. (These steps may vary depending on your exact setup / requirements. Feel free to get in touch if you have questions.)

Adding a Real Domain Name

By default, every website you create in VirtualHostX is given a URL like http://something.vhx.cloud. That's the URL you use locally on your Mac for testing purposes. Other people on the internet won't be able to access your website with that URL because the vhx.cloud domain name isn't real - it only works on your Mac. So, you'll need to buy a real domain name and point it to your Mac's public IP address. In general, the steps to do that are...

  1. Buy a domain name from a domain registrar. Personally, I've used I Want My Name since 2011 for all of my domains. I've currently got about 30 in use with them. (That's not an affiliate link. I just really like them!)
  2. After purchasing, you need to set your new domain's DNS A record(s) to your Mac's public IP address. It may take 24 - 48 hours for that change to take effect across the entire internet.
  3. Then, you need to use VirtualHostX to configure your web server to handle your domain name.

Allowing Access to your Mac from the Internet

If your Mac is hosted in a data center or has a direct connection to the internet (not behind a firewall, proxy, router, etc) then at this point you probably already know what you're doing and are good to go.

However, if your Mac is hosted at home or in your office, behind a router / firewall / etc, then you'll need to allow traffic to your Mac's local IP address on TCP port 80.

Opening up access in your router / firewall varies depending on your network configuration and what type of router / modem / switch is between you and the internet. Ask your IT person or your newphew that builds apps for advice.

Note: By default, VirtualHostX's web server listens on port 8080. This is both for security reasons and also to prevent conflicts with any other old web servers you might have running on your Mac. What this means for you is, when you open up port 80 on your network's firewall / router, you'll need to route that traffic to your Mac's local IP address at port 8080. However, if you used VHX's "Bind to Ports 80 and 443..." command to make your web server run using the standard port numbers (80 and 443), then you don't need to worry about using port 8080. Just point the traffic to your Mac to port 80 like normal.

HTTPS and SSL

If you want your website to be served over a secure HTTPS connection (which you should!), then you'll need to take additional steps.

First, in addition to opening up port 80 as described in the previous section, you'll also need to allow traffic on port 443 to your Mac's local IP address and then use the "Bind to Ports 80 and 443..." command under VHX's "Web Server" menu.

Next, you need to acquire and install an SSL certificate. In order for this to work, your SSL certificate must be trusted by all the major web browsers, otherwise your visitors will get a scary warning and be blocked from visiting your website. And the only way to gain the trust of the web browser vendors is to have your certificate signed by a certificate authority. Traditonally, getting a signed certificate costs around $100 / year. If you have a valid cert already, VirtualHostX can install it for you.

Luckily, in recent years, a new non-profit called Let's Encrypt has begun issuing free SSL certificates that are trusted by all web browsers. You can generate and use a certificate issued by them and import it into VHX.

Even better, beginning January 2020, VirtualHostX Pro will be able to integrate directly with Let's Encrypt and create a trusted SSL certificate for you. This FAQ will be updated with instructions when that feature becomes available.