Running Universal Dashboard with Ubuntu and Nginx (With HTTPS!)

A basic UniversalDashboard running on nginx



For this writeup, I’m using Ubuntu 18.04. Software packages are geared toward using that version.

First, we’ll need to install our dependencies

There are several ways to install Powershell core on Ubuntu. I recommend Microsoft’s documentation for ubuntu 18.04 here

Once installed, enter Powershell and install the UniversalDashboard module. This will use the community edition.

Confirm it is installed:

Next, we need to install our webserver:


First we need to have a dashboard to run, along with a place to run it.

Create a project directory. This example uses my-site at the root of my user profile.

Place the following into a file called dashboard.ps1 and place it at the root of your project:

NOTE: You may have a dashboard which includes many folders, depending on the structure of your project. In that case, copy the entire folder structure into your project folder (my-site). Make sure dashboard.ps1 is at the root of this folder.

Now, we need to configure our webserver to act as a reverse-proxy. This is done to make our site available via SSL in a very simple manner.

Let’s create a very basic reverse-proxy configuration within nginx. Navigate to /etc/nginx/sites-available and remove the default file. This file is symlinked to /etc/nginx/sites-enabled/default, so remove it as well.

Next, head back to /etc/nginx/sites-available and create a file called dashboard.conf

Place the following in it:

Now we need to symlink our proxy’s config file to the sites-enabled folder:

Next, we need it to run as a service so we can control our dashboard with systemctl. I’m using Ubuntu, so I’m going to use systemd to manage my service.

Navigate to /etc/systemd/system and create a service file for our service:

Place the following in the service file. Note the path in ExecStart. This will need to match the path of your project’s dashboard.ps1 file. Also ensure the user specified to run the service has permissions to access your project folder.

Now, start your dashboard:

Your site should now be available at http ://localhost:80

Finally, we want to enable our service so that it starts at boot and will attempt error correction if stopped unceremoniously.

You should now have a fully functioning dashboard.

If you’d like to configure SSL, read on!

Configuring HTTPS

For this tutorial, I’m using Let’s Encrypt certificates. For more information on how to obtain LE certs, check out the Let’s Encrypt documentation on getting started.

Make a directory for your certificates. Exactly where is up to you.

Since I’m using Let’s Encrypt, I have 2 certificate files I need to put here – fullchain.pem and privkey.pem.

Be sure to set permissions on both to 400 (user read-only)

Next, we need to modify our nginx config file to listen on HTTPS.

Now, we will listen on port 443, and port 80, which will perform a redirect to the secure version of our site:

NOTE: Change server_name to your own servername

Now, simply reload nginx

You should now have a secure Universal Dashboard server, running as a service. Huzzah!

NOTE: This is a cross-post from my original blog post: