Self-hosted

RL
RL
Last updated 15 days ago

pgDash is available as a self-hosted package that can be installed within your datacenter or cloud instances. The self-hosted version of pgDash is entirely self-contained and does not require internet access for its operation. It stores all its data in a PostgreSQL database, which has to be provisioned and managed by you. Self-hosted pgDash has all the same features as the SaaS version of pgDash hosted at https://app.pgdash.io.

Availability

The pgDash server binary package is available in .deb installer package and .tar.gz tarball formats. RPM packages will be available soon. These packages can be downloaded from the RapidLoop download server at https://packages.rapidloop.com/downloads as well as the RapidLoop APT repo. Instructions below.

Currently we support running pgDash on Debian 9 and Ubuntu 18.04 LTS distros. It is possible to run pgDash as a Docker container, see instructions below.

pgDash needs PostgreSQL 10. It will not work with version 9 or below. We recommend a dedicated database and a dedicated PostgreSQL user for pgDash.

You will be able to setup the pgDash server by following the instructions on this page. However, a license file is needed for the server to start. Please contact us at sales@rapidloop.com and we'd be happy to provide you with a license file for a Free Trial to take pgDash on a test run!

The current version of pgDash self-hosted is 1.25.2.

Setup

You can install the pgDash server from the RapidLoop APT repo (recommended), or by downloading and installing the .deb installer, or directly using the tarball.

Using the RapidLoop APT Repo

1. Add the RapidLoop repo:

echo "deb https://packages.rapidloop.com/debian stable main" |
sudo tee /etc/apt/sources.list.d/rapidloop.list

2. Import the RapidLoop signing key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E1BACF5

If the above step does not work (the keyserver is down, for example), you can also do it by fetching the GPG public key from our servers and importing it manually:

wget https://packages.rapidloop.com/gpg-pubkey-rapidloop.asc
sudo apt-key add gpg-pubkey-rapidloop.asc

3. Fetch the RapidLoop package information:

sudo apt-get update

4. Install the pgDash server package:

sudo apt-get install pgdash-server

Using the .deb installer

1. Download the .deb file:

wget https://packages.rapidloop.com/downloads/pgdash-server_1.25.2_amd64.deb

2. Install the package using the dpkg command:

dpkg -i pgdash-server_1.25.2_amd64.deb

Using the .tar.gz tarball

Download the .tar.gz tarball:

wget https://packages.rapidloop.com/downloads/pgdash-server-1.25.2.amd64.tar.gz

2. Unpack the tarball

tar xvf pgdash-server-1.25.2.amd64.tar.gz

3. The pgDash server can be started with the current working directory as the root of the unpacked tarball. The server will look for all files (like /etc/pgdash/pgdash.cfg, /var/log/pgdash/pgdash.log) relative to this directory.

cd pgdash-server-1.25.2-amd64
usr/sbin/pgdashd

The pgDash server will run in the foreground until interrupted by ^C.

Running as a Docker Container

The pgDash server itself is not available as a Docker container, because you'll typically need to edit the configuration file and supply a license file before it can start. We recommend building your own container using this Dockerfile as a starting point:

Dockerfile
FROM ubuntu:18.04
ENV PGDASH_VERSION 1.25.2
RUN apt-get update
RUN apt-get -yq install wget
RUN wget https://packages.rapidloop.com/downloads/pgdash-server_${PGDASH_VERSION}_amd64.deb
RUN dpkg -i pgdash-server_${PGDASH_VERSION}_amd64.deb
COPY pgdash.cfg /etc/pgdash
COPY ABCDE-FGHIJ-KLMNO-PQRST.lic /etc/pgdash
ENTRYPOINT ["/usr/sbin/pgdashd"]

Place your custom pgdash.cfg and the license file in the same directory as this Dockerfile and use the docker build command to build your container.

System Requirements

The main pgDash application is a single, native binary that runs as a daemon. As such, it has low memory and CPU requirements. It does not store any state on-disk, and relies on the PostgreSQL database for storage of all persistent data, including timeseries data.

System Clock

The system on which pgDash is running must have it's clock synchronized via NTP or similar. An incorrect clock may result in unexpected behavior.

System Time Zone

We highly recommend that the time zone of the system on which pgDash is running is set to UTC. Note that the timestamps shown in the browser when you access pgDash will still appear in the time zone of the browser's machine.

Reverse Proxy

It is possible to run pgDash behind a reverse proxy. To host pgDash at a location like https://internal.company.com/pgdash, and assuming the fronting server is nginx, you can configure nginx like:

location /pgdash/ {
proxy_http_version 1.1;
proxy_pass http://internal.pgdash.server:8080/;
}

and also add the following in the pgDash configuration file (/etc/pgdash/pgdash.cfg):

exturl = 'https://internal.company.com/pgdash'

Configuration

The pgDash daemon (/usr/sbin/pgdashd) is installed as a systemd service (pgdashd.service). On startup, it reads the configuration file /etc/pgdash/pgdash.cfg. Please refer the comments in that file to edit it to suit your needs.

You'll need to provision a PostgreSQL v10 database for pgDash's use. We recommend a dedicated database, and a dedicated PostgreSQL user pgDash. You'll need to specify the connection parameters to this database in /etc/pgdash/pgdash.cfg, like so:

dsn = 'host=my.db.host user=pgdash dbname=pgdash'

pgDash will create and manage the schema in the database without any extra steps.

The license file that you receive should be placed in /etc/pgdash, and must be readable at least by the system user "pgdash" or the system group "pgdash". Do not rename the license file that you receive.

Getting Started

Once you have pgDash up and running, you'll be able to browse to http://pgdash:8080/ (or whichever URL you configured) and see the login page. New users can signup to your instance of pgDash.

You can use the same steps as the SaaS version for Getting Started, with one change -- the pgdash command-line tool must be instructed to send the data to your instance rather than the SaaS instance. This is done by using the "--base-url" argument for pgdash:

pgmetrics --no-password -f json -h server.name mydb1 |
pgdash --base-url=http://pgdash:8080/api/v1 -a MYAPIKEY report server.name

All other aspects of using pgDash remain the same, and further documentation can be found in other sections of this manual.

Administration

pgDash comes with a command line tool pgdash-admin to perform administrative tasks. Use the --help option to see what commands are available:

pgdash-admin --help

Log files will be present in /var/log/pgdash.

Support

Please contact us at support@rapidloop.com for any help with your self-hosted pgDash instance.

Free Trial

If you'd like to take pgDash for a test-drive, email us at sales@rapidloop.com and we'll get you setup with a self-hosted Free Trial.