How to host YOURLS on Hetzner VM Instance - ServerAvatar

Published : Sep 5, 2024

Share This Post

cloud-platform

Hetzner

Hetzner provides a range of services like dedicated hosting, virtual private servers, colocation services, and domain registration. Hetzner is known for having reliable systems and competitive prices in web hosting.

Get started with Hetzner
application

YOURLS

YOURLS is a powerful set of PHP scripts that allows you to run Your Own URL Shortener on your server.

More info

YOURLS is an open-source URL-shortening platform known for its features and flexibility. It allows users to efficiently create and manage short links, offering features for link tracking, custom URL generation, and analytics. With a range of plugins and customizable options, YOURLS supports personalized URL-shortening solutions without requiring deep technical knowledge. Hetzner is recognized for its dependable infrastructure scalability and user-friendly deployment options. ServerAvatar simplifies the deployment process of the YOURLS application on Hetzner VPS with easy-to-follow steps.

Create a Server in Hetzner

Getting Started with Hetzner:

Hetzner provides a range of services like dedicated hosting, virtual private servers, colocation services, and domain registration. Hetzner is known for having reliable systems and competitive prices in web hosting. Its services work well for both individual users and businesses that need strong hosting options.

Step 1: Login to Hetzner Cloud Console

  • Go to the Hetzner Cloud website and sign in using your credentials.

Step 2: Create a New Project (Optional)

  • If you don't have an existing project, create a new one by clicking on the New Project button.

Create a Server in Hetzner

  • Enter a name for your project and click Add Project.

Create a Server in Hetzner

Step 3: Select a Project

  • Select the project in which you wish to create your server.

Create a Server in Hetzner

Step 4: Create a New Hetzner Cloud Server

  • Navigate to the Servers sub-menu and click on Add Server to begin creating your server.

Create a Server in Hetzner

Step 5: Configure your server

  1. Select a Location: Select the data center location where you want to deploy your server. Choose the region that is closest to your target audience for better performance. Create a Server in Hetzner
  2. Select an Image: ServerAvatar supports both Ubuntu 20.04 and Ubuntu 22.04. Therefore, choose one of these supported operating systems. Create a Server in Hetzner
  3. Select a Server Type: Hetzner provides various plans with different configurations of CPU, RAM, and storage. Select the server type based on your requirements. The minimum requirement for hosting YOURLS is 1GB of RAM, more is recommended for smoother performance, especially if you’re running other services on the server. The exact amount will depend on your usage and data storage needs. Create a Server in Hetzner
  4. Select Networking: Select from three networking options for your server. Private networks allow you to securely connect servers within the same data center without going over the public internet. Create a Server in Hetzner
  5. SSH Key or Root Password: Select an SSH Key if you want to authenticate with an SSH key. This method is recommended over using a root password for enhanced security. If you choose SSH key authentication, Hetzner will disable password-based authentication by default. Otherwise, you will receive the root password via email. Create a Server in Hetzner
  6. Add a Firewall Rule: Configure firewall rules to control incoming and outgoing traffic based on IP addresses, ports, and protocols for improved security. Create a Server in Hetzner
  7. Additional Options (Optional): Configure additional options such as Backups, Placement Groups, Volumes, Labels, and Cloud Config as per your Requirements.
  8. Give a Server Name: Enter a server name for easy identification. Create a Server in Hetzner
  9. Finalize and Create: Review your configuration settings to ensure that everything is configured correctly. Click on the Create & Buy Now button.9. Finalize and Create: Review your configuration settings to ensure that everything is configured correctly. Click on the Create & Buy Now button. Create a Server in Hetzner

Step 6: Access Your Server

  • Once the server is deployed, it will appear on your Hetzner Cloud dashboard. Use the provided IP address and SSH key (if configured) to access your server via SSH. Now, You can connect your Server with ServerAvatar for Server management.

Create a Server in Hetzner

Initial Server Configuration

The Initial server configuration includes the installation and configuration of various packages required to host your website. Usually, You have to write commands and modify configuration files. Luckily, With ServerAvatar, Your full server configuration and optimization can be automated.

Here are the three ways to automatically configure your server with ServerAvatar.

Install and Setup YOURLS on Cloud using ServerAvatar

Getting Started With YOURLS:

YOURLS is a powerful set of PHP scripts that allows you to run Your Own URL Shortener on your server. This gives you full control over your links, provides detailed statistics, supports plugins, and much more, all in a free and open-source package.

Key Features:

  • Open Source: YOURLS is open-source, so you can modify and use it according to your needs.
  • Extensible: You can extend its functionality using various Plugins available in the YOURLS environment.
  • Total Control: YOURLS allows you to manage your short links, putting your branding front and center by using your own domain or subdomain.
  • Detailed Insights: Get detailed insights into link performance with YOURLS' comprehensive statistics and analytics, helping you understand how your links are performing.

Requirements:

  • Web Server: YOURLS requires Apache version 2.4 or greater, with the mod_rewrite module enabled.
  • PHP: PHP version 7.4 or greater is needed for YOURLS to work correctly. If you plan on using the YOURLS API, make sure the PHP cURL extension is enabled.
  • Database: MySQL 5.0 or greater & MariaDB 10.0 or greater for storing link data.
  • HTTPS Support: For security reasons, it's recommended to host your YOURLS installation on a server with HTTPS support.

Install and Setup YOURLS on Cloud using ServerAvatar:

Step 1: Create an Application

  • To create a new Custom application for YOURLS, navigate to the Applications tab on the server panel. Click on the Create button on the server panel to start the process of application creation.

Install and Setup YOURLS on Cloud using ServerAvatar

  • On the following screen, fill in the Application details, including:

    • Application Name: enter your Application Name.
    • Select Domain: Select between a Test Domain or a Primary Domain as per your requirements.
    • Enter Domain: Enter your Application Domain.
    • Method: Select Git as your application method.
    • Service Provider: Select GitHub as service provider for cloning the repository.
    • Repository Type: Public
    • Clone HTTPS URL: https://github.com/YOURLS/YOURLS.git
    • Branch: master
    • Deployment Script: composer update (to update the composer after cloning)

Install and Setup YOURLS on Cloud using ServerAvatar

  • Now, your Application is ready. You can see your Application in the Dashboard.

Install and Setup YOURLS on Cloud using ServerAvatar

Step 2: Create a Database

  • To create a Database that stores your confidential data, Go to the Dashboard and click on the Databases option. Enter Your Database name and just hit on the “Create a Database” button as shown in the image below.

Install and Setup YOURLS on Cloud using ServerAvatar

  • After successfully creating a Database, you can see your Database in the Databases Dashboard.

Install and Setup YOURLS on Cloud using ServerAvatar

Step 3: Copy config.php File

  • Go to Application Dashboard and navigate to File Manager open the public_html folder by clicking on it.

Install and Setup YOURLS on Cloud using ServerAvatar

  • Select the sample-config.php and click on copy icon as shown in the image below.

Install and Setup YOURLS on Cloud using ServerAvatar

  • In the pop-up of Copy File enter the location for the file to copy at /public_html/user/config.php and click on the Copy button as shown in the below image.

Install and Setup YOURLS on Cloud using ServerAvatar

Step 4: Update config.php File

  • After copying the config.php file, open it and modify fields such as Database Name, Database Username, Password, and YOURLS Site.

Install and Setup YOURLS on Cloud using ServerAvatar

  • To find your database credentials, navigate to the Databases section in the server panel and click on the manage users icon next to the database you have set up for your application.

Install and Setup YOURLS on Cloud using ServerAvatar

  • You can see your Database credentials as shown in the image below.

Install and Setup YOURLS on Cloud using ServerAvatar

Step 5: Update your Custom Webroot

  • Navigate to the Settings section in your Application panel and add admin to your custom webroot path as shown in the below image and click on Update Custom Webroot.

Install and Setup YOURLS on Cloud using ServerAvatar

Step 6: Access YOURLS

  • Now, to access the YOURLS, open your web browser and enter your site's domain.
    • Example: http://yourlsapp.satesting1.click
    • For instance: http://your-application-domain
  • It will redirect You to Yourls installation page.

Install and Setup YOURLS on Cloud using ServerAvatar

  • Now, Click on the Install YOURLS Button.

Install and Setup YOURLS on Cloud using ServerAvatar

  • After completing the Installation process, You will see the go to YOURLS Administration Page as shown in the below image.

Install and Setup YOURLS on Cloud using ServerAvatar

  • You can log in to the YOURLS Administration page using the username and password.
    • Username: Your Username
    • Password: Your Password

Install and Setup YOURLS on Cloud using ServerAvatar