Self-hosted
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 requires 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.
The pgDash server binary package is available in .deb and .rpm installer packages and .tar.gz tarball format. These packages can be downloaded from the RapidLoop download server at https://packages.rapidloop.com/downloads as well as the RapidLoop APT/YUM repo. Instructions below.
Currently we support running pgDash on Debian 10, Debian 11, Ubuntu 20.04 LTS, Ubuntu 22.04 LTS, and RHEL/Centos/Rocky Linux 8 distros. It is possible to run pgDash as a Docker container, see instructions below.
pgDash needs PostgreSQL 10 or above. 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 [email protected] 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 3.1.24.
You can install the pgDash server from the RapidLoop APT/YUM repo (recommended), or by downloading and installing the .deb/.rpm installer, or directly using the tarball.
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
1. Download the .deb file:
wget https://packages.rapidloop.com/downloads/pgdash-server_3.1.24_amd64.deb
2. Install the package using the
dpkg
command:sudo dpkg -i pgdash-server_3.1.24_amd64.deb
1. Add the RapidLoop YUM repo:
sudo tee /etc/yum.repos.d/rapidloop.repo <<EOF
[rapidloop]
name=RapidLoop Public YUM Repository
baseurl=https://packages.rapidloop.com/centos
gpgkey=https://packages.rapidloop.com/gpg-pubkey-rapidloop.asc
EOF
2. Import the RapidLoop signing key:
wget https://packages.rapidloop.com/gpg-pubkey-rapidloop.asc
sudo rpm --import gpg-pubkey-rapidloop.asc
3. Update the local metadata:
sudo yum update
4. Install the pgDash server package:
sudo yum install pgdash-server
1. Download the .rpm file:
wget http://packages.rapidloop.com/downloads/pgdash-server-3.1.24-1.x86_64.rpm
2. Install using the rpm command
sudo rpm -ihv pgdash-server-3.1.24-1.x86_64.rpm
Download the .tar.gz tarball:
wget https://packages.rapidloop.com/downloads/pgdash-server-3.1.24.amd64.tar.gz
2. Unpack the tarball
tar xvf pgdash-server-3.1.24.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-3.1.24-amd64
usr/sbin/pgdashd
The pgDash server will run in the foreground until interrupted by ^C.
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 debian:11
ENV PGDASH_VERSION 3.1.24
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
VOLUME /var/lib/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.The timeseries and other metrics data is stored under
/var/lib/pgdash
, which should be persisted into a Docker volume. Log files created under /var/log/pgdash
, as well as configuration files in /etc/pgdash
can also be stored on volumes if desired.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.
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.
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.
pgDash stores timeseries data (metrics, and parts of pgmetrics reports) in a compressed format under
/var/lib/pgdash
. There should be sufficient storage and IOPS for the filesystem where this directory will be located. 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'
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 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. The pgDash service must be restarted for changes to take effect. The following steps are recommended:1. Ensure that the license file is present in the /etc/pgdash directory
2. sudo chmod 0400 /etc/pgdash/*.lic
3. sudo chown pgdash.pgdash /etc/pgdash/*.lic
4. sudo systemctl restart pgdashd
The files in
/etc/pgdash
should look like:$ ls -l /etc/pgdash
total 12
-r-------- 1 pgdash pgdash 120 Mar 15 10:30 J9NYY-KMSR6-IXJ3M-OQHZR-RDKTK.lic
-rw-r----- 1 pgdash root 3886 Mar 27 08:23 pgdash.cfg
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.
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.
If you'd like to take pgDash for a test-drive, email us at [email protected] and we'll get you setup with a self-hosted Free Trial.
Last modified 4mo ago