How to Install Dashboard on Ubuntu Server

Dashboard is a self-hosted web application that allows you to monitor and control your servers and applications. It's an open-source project and is available on GitHub. In this tutorial, we'll guide you through the installation process of Dashboard on the latest Ubuntu Server.

Prerequisites

Before you start, you'll need:

  • An Ubuntu Server with root or sudo privileges
  • A web server (such as Apache or Nginx) installed and configured
  • A database system (MariaDB or PostgreSQL) installed and configured
  • PHP 7.2 or higher installed and configured

Installation

Here are the steps to install Dashboard on Ubuntu Server:

Step 1 - Install Composer

Composer is a package manager for PHP. To install Composer, run the following command:

sudo apt install composer

Step 2 - Clone the Repository

Next, clone the Dashboard repository from GitHub:

git clone https://github.com/phntxx/dashboard.git

Step 3 - Install Dependencies

CD into the Dashboard directory and run the following command to install the dependencies:

composer install

Step 4 - Configure the Environment Variables

Copy the .env.example file to .env and configure the necessary environment variables:

cp .env.example .env
nano .env

Here are the required environment variables:

  • APP_ENV: Set it to production.
  • APP_DEBUG: Set it to false.
  • APP_URL: Set it to the URL where you'll host Dashboard.
  • DB_CONNECTION: Set it to the database system you're using (either mysql or pgsql).
  • DB_HOST: Set it to the hostname or IP address of your database server.
  • DB_PORT: Set it to the port your database system is running on (usually 3306 for MySQL and 5432 for PostgreSQL).
  • DB_DATABASE: Set it to the name of the database you've created for Dashboard.
  • DB_USERNAME: Set it to the username you're using to connect to the database.
  • DB_PASSWORD: Set it to the password for the username you're using to connect to the database.

Save and close the file when you're done.

Step 5 - Prepare the Database

Run the following command to prepare the database:

php artisan migrate

Step 6 - Seed the Database

If you want to add some initial data to the database, you can run the following command:

php artisan db:seed

Step 7 - Link the Storage Directory

Run the following command to link the storage directory to the public directory:

php artisan storage:link

Step 8 - Configure the Web Server

Finally, configure your web server to serve the Dashboard application. For Apache, you'll need to create a virtual host and point it to the public directory. For Nginx, you'll need to create a server block and configure the root directory.

Here's a sample configuration for Apache:

<VirtualHost *:80>
    ServerName dashboard.example.com
    DocumentRoot /var/www/dashboard/public

    <Directory /var/www/dashboard/public>
        AllowOverride None
        Require all granted
        Options FollowSymLinks
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/dashboard_error.log
    CustomLog ${APACHE_LOG_DIR}/dashboard_access.log combined
</VirtualHost>

Restart your web server after making the changes.

Conclusion

That's it! You've successfully installed Dashboard on your Ubuntu Server. You can now access it via your web browser and start monitoring and controlling your servers and applications.