How to Install GarageHQ on Ubuntu Server Latest
GarageHQ is a self-hosted platform designed for car enthusiasts to keep track of their car records and maintenance. This tutorial will guide you on how to install GarageHQ on your Ubuntu Server.
Prerequisites
Before we proceed with the installation, ensure that you have the following:
- Ubuntu Server Latest
- Root or sudo access
Step 1: Update your Ubuntu Server
The first step is to ensure that your Ubuntu Server is up-to-date. Run the following command to update the installed packages:
sudo apt update && sudo apt upgrade -y
Step 2: Install Required Packages
GarageHQ requires the following packages to be installed on your Ubuntu Server:
- git
- curl
- unzip
- apache2
- php7.4
- php7.4-curl
- php7.4-gd
- php7.4-mbstring
- php7.4-mysql
- php7.4-xml
- libapache2-mod-php7.4
To install these packages, run the following command:
sudo apt install git curl unzip apache2 php7.4 php7.4-curl php7.4-gd php7.4-mbstring php7.4-mysql php7.4-xml libapache2-mod-php7.4 -y
Step 3: Download and Install GarageHQ
Next is to download and install GarageHQ. Follow the steps below:
- Create a directory where you want to install GarageHQ. For this tutorial, we will create a directory called
garagehqinside the/var/www/htmldirectory:
cd /var/www/html
sudo mkdir garagehq
- Navigate to the newly created
garagehqdirectory:
cd garagehq
- Download the latest release of GarageHQ by running the following command:
sudo curl -LOk https://github.com/deuxfleurs/GarageHQ/releases/latest/download/GarageHQ.zip
- Unzip the downloaded file by running:
sudo unzip GarageHQ.zip
- Give the Apache web server permissions to read and write the GarageHQ files:
sudo chown -R www-data:www-data /var/www/html/garagehq
sudo chmod -R 755 /var/www/html/garagehq
Step 4: Configure Apache Web Server
Now we need to configure Apache web server to serve GarageHQ. Follow the steps below:
- Open the default Apache virtual host configuration file:
sudo vi /etc/apache2/sites-available/000-default.conf
- Add the following lines at the end of the
<VirtualHost>section:
Alias /garagehq /var/www/html/garagehq/public
<Directory /var/www/html/garagehq/public>
AllowOverride All
Order allow,deny
allow from all
Require all granted
DirectoryIndex index.php
</Directory>
Save the file.
Restart the Apache web server:
sudo systemctl restart apache2
Step 5: Configure GarageHQ
Next, we need to configure some settings in GarageHQ.
- Navigate to the
garagehqdirectory:
cd /var/www/html/garagehq
- Rename the
.env.examplefile to.env:
sudo mv .env.example .env
- Open the
.envfile with any text editor of your choice:
sudo vi .env
- Change the two lines:
APP_URL=http://localhost:8000
APP_ENV=production
to:
APP_URL=http://your_IP_address/garagehq
APP_ENV=production
- Save the file.
Step 6: Run GarageHQ
Finally, we need to run GarageHQ. Follow the steps below:
- Navigate to the
garagehqdirectory:
cd /var/www/html/garagehq
- Install the required dependencies by running:
sudo composer install
- Generate a new application key by running:
sudo php artisan key:generate
- Migrate the database by running:
sudo php artisan migrate --seed
- Start the built-in PHP web server:
sudo php artisan serve
Access GarageHQ in your browser by visiting
http://your_IP_address:8000/garagehq.To stop the PHP web server, press
CTRL+Con your keyboard.
Conclusion
Congratulations! You've successfully installed and configured GarageHQ on your Ubuntu Server. Now you can start using GarageHQ to keep track of your car records and maintenance.