Self-hosting

Self-hosting

Self-hosting

Have full control of your data by self-hosting Basedash on your own servers.
image

Enterprise users may choose to run a self-hosted version of Basedash for privacy and security reasons.

GitHub repository

There is a GitHub repository that contains all of the setup code. This code will be copied into a server using a git clone command and then you will be able to run scripts that will help setup the server to run Basedash.

GitHub repository

Setup instructions

We have detailed setup instructions for AWS and GCP. However, it should be possible to host Basedash on any hosting provider that supports Docker images.

AWS EC2
AWS ECS
Google Cloud Platform

Slack notifications

You’ll need to create a new Slack app, provide the chat:write scope to the bot, and then use the provided client ID and client secret as environment variables to the Docker image.

image

You’ll also need to add a Redirect URL to your slack app config that corresponds with the URL of your self-hosted basedash app. Note, your app must be hosted on HTTPS for this to work.

image

Renewing SSL certificates

You can manually update the certificates by running the following commands from the self-hosted directory:

docker-compose run certbot
docker-compose restart nginx

Read this article on how to use cron jobs with certbot to automatically renew SSL certificates.

Upgrading Basedash versions

Simply run the update.sh script from the self-hosted directory.

Database

The current self-hosted setup creates a local postgres database using docker on the self-hosted server. The database data is persisted to the server through a docker volume. If you'd like to use a database hosted elsewhere, you should be able to do an SQL dump of the docker database, import the SQL dump to another database, and change the environment variables related to the database credentials. Restart the server using docker-compose up -d --force-recreate and then the app should be using the new database.

📢
Remember to whitelist the Basedash server's IP on your database host so your database allows connections from the Basedash app.

Environment variables

The following are all the available environment variables that can be used to configure Basedash. The values can be added and modified in the docker.env file.

BASEDASH_LICENSE_KEY

Required to run the app. Provided by the Basedash team.

Required

AWS_ACCESS_KEY_ID

AWS access key used by the AWS JS SDK to authenticate requests to S3. See AWS documentation on how to retrieve this value. We recommend creating a new IAM user with All S3 actions enabled for the S3 bucket.

This environment variable is optional since you can also assign an IAM role to the EC2 instance that is running your self-hosted Basedash instance and the SDK will be able to automatically pickup the IAM credentials on your instance.

AWS_SECRET_ACCESS_KEY

AWS secret access key. See AWS documentation on how to retrieve this value.

Optional since you may be relying on IAM roles associated with the EC2 instance assigned to your Basedash server.

AWS_REGION

Region used for your AWS S3 bucket, e.g. us-east-1.

BUCKET_ENDPOINT

S3 (or digital ocean) bucket endpoint, e.g. https://3.us-east-1.amazonaws.com

Required

BUCKET_NAME_IMAGES

This should be equal to your value for BUCKET_NAME. This environment variable won't be required in a future release.

Required

BUCKET_NAME_KEYS

This should be equal to your value for BUCKET_NAME. This environment variable won't be required in a future release.

Required

BASE_URL

The domain of the web application. Used for the links in Slack notifications and login magic links.

example: https://app.basedash.com

Required

CRYPTO_KEY

A random string of characters used when hashing passwords for storage in the database. Randomly generated from the self-hosted setup script. Needs to be 32 characters in length.

example: &E(H+MbQeThWmZq4t7w!z%C*F-J@NcRf

Required

POSTGRES_HOST

Host for postgres database.

Required

POSTGRES_DB

Postgres database name

Required

POSTGRES_PASSWORD

Postgres database password

Required

POSTGRES_PORT

Postgres database port

Required

POSTGRES_USER

Postgres database username

Required

POSTGRES_SSL_CA_CERT

Certificate authority (CA) certificate associated with postgres database. Used for SSL database connections and only necessary for apps that want to enable SSO and have their database SSL protected.

RESEND_API_KEY

Used for transactional emails in the app, including email verification during signup.

Required

TWILIO_ACCOUNT_SID TWILIO_AUTH_TOKEN TWILIO_VERIFY_SERVICE_SID

Twilio is the SMS two factor authentication provider used for the Basedash app.

If this is not setup, you will not be able to have two-factor authentication in Basedash. The Basedash team can provide you with a Twilio API key.

SLACK_CLIENT_ID

Used to enable Slack notifications on views. Note that your app must be accessible via HTTPS in order for this to work.

If this is not setup, you will not be able to enable Slack notifications.

SLACK_CLIENT_SECRET

Used to enable Slack notifications on views. Note that your app must be accessible via HTTPS in order for this to work.

If this is not setup, you will not be able to enable Slack notifications.

GOOGLE_OAUTH_CLIENT_ID

Used for “Sign in with Google”. Note that your app must be accessible via HTTPS in order for this to work.

If this is not setup, you will not be able to login/signup with Google.

OPENAI_API_KEY

Used for various AI features across the app, such as generated values and “Ask AI”.

The Basedash team can provide you with an OpenAI API key if you do not have one.

INTERCOM_APP_ID

Used to have intercom chat support with the Basedash team.

LOG_LEVEL

Controls the minimum level of logs outputted to the console. Can be one of 'error', 'warn', 'info', 'http', 'verbose', 'debug', or 'silly'.

default: info

ENABLE_HTTP_LOGS

Used if you'd like to get logs for every HTTP request made to the server.

default: false

DEBUG_SQL

Outputs SQL errors to the console. Useful for debugging SQL errors, even when in production.

default: false

ENABLE_SQL_LOGGING

Will log out all SQL queries made to databases connected to Basedash.

default: false

RABBITMQ_URL

URL of the RabbitMQ service. Defaults to URL of a RabbitMQ service running via docker-compose.

default: amqp://localhost:5672

Version number

You can identify the version number of your self-hosted Basedash instance by inspecting the HTML of your Basedash app and looking for the <meta name="version" content="XXX"> tag.

image

This version should correspond with a docker image tag found on docker hub (https://hub.docker.com/repository/docker/basedash/basedash/tags?page=1&ordering=last_updated).

image