Installation

Learn how to install UrlHum on your system

To begin the installation, login into your server and configure Apache or Nginx to work with the new project.
Remember: the root directory must point to public, not the folder of the application itself.
You can check an Nginx configuration sample file here.

Then, cd in the folder you will install UrlHum.

Clone the GitHub repository

To clone the UrlHum repository, be sure you have GIT installed, then type:

git clone https://github.com/urlhum/UrlHum.git .

🚧

Attention to the dot!

Note: the . (dot) stands for "current folder". If you aren't in the folder you want to install UrlHum to, please point to it using a relative path.
For example: to install UrlHum in the directory urlshorter, you must type that instead of the .

Edit and rename the .env-example file

Open the .env-example file provided with the package.
We recommend to edit only these values if you don't know what to do:

Variable

Description

APP_NAME

Write your website name here. Is shown when UrlHum will send email to users. If your website name contains a space, write it between ", like "Url Hum", for example

DB_CONNECTION

If you're using MySQL don't touch this. Otherwise type in your database driver

DB_HOST

If you have the database on the same machine/server you're working on, leave it to *localhost, otherwise set it to your database address

DB_PORT

Default port for MySQL is 3306, otherwise type your database port

DB_DATABASE

Type the name of the database you have created for UrlHum

DB_USERNAME

Type the name of the user you have on your machine/server that has permission to manage the database you created

DB_PASSWORD

Type the user password that has said permission

You might also like to edit email settings.
If you don't use SMTP, just set MAIL_DRIVER to mail and set MAIL_FROM_ADDRESS and MAIL_FROM_NAME.
If you use SMTP; set settings as follows:

Variable

Description

MAIL_DRIVER

If you want to use any of the Default Laravel Drivers, type that. Otherwise, type smtp

MAIL_HOST

Type the host of your SMTP driver. For example, smtp.mailtrap.io

MAIL_PORT

Type the port of your SMTP host. This is different from host to host, so check your host configuration page

MAIL_USERNAME

This is the username your SMTP host gave you. You can check it in host configuration page

MAIL_PASSWORD

This should be a secret key your SMTP host generated for you. Paste it here and don't share it anywhere else

MAIL_FROM_ADDRESS

Type the address you want the emails get send from. To don't end up in spam folders, use a domain you added in your SMTP host

MAIL_FROM_NAME

Almost certainly you'd like to set this to your website name, it is shown in the email message as from

For any reason, don't type anything in APP_KEY. This key is needed for encryption and we will generate the key later using a Laravel command.

After editing the .env-example file, rename it from .env-example to .env.
If you are on a Linux-based envrionment, you can do so with this command:

mv .env-example .env

Run the UrlHum installation

After cloning the repository inside your folder, cd in it if you haven't already, then install every UrlHum dependency using composer.

composer install

At the moment we recommend to install UrlHum this way because it is still in early development state. But, if you want to install only essential packages to play around with UrlHum, you can do so with:

composer install --no-dev

Generate the application key

To encrypt some data for Laravel, we need an application key. After setting it, never change it again and don't share it with anyone.
To set the key, just type this command:

php artisan key:generate

Install assets

To install assets provided with UrlHum, you must use NPM and run the installation always from the command line. This can take a while. Please be patient!

npm install

After installing assets, you need to compile them. You either run

npm run dev

to compilate development assets, or you can run

npm run prod

to compilate production assets. In a non-development environment you should use the production assets.

Migrate and Seed the Database

To let UrlHum work properly, we need to Migrate tables and to seed it.
This will create the tables UrlHum needs to work and will create some data in the columns (an admin user and system settings).
First, let's run the migration:

php artisan migrate

🚧

Common error

If you encounter an error when running this command, the most common problem is wrong database data. Please go back to the .ENV file and be sure you entered correctly your database details.

After successfully running the migration, we can now seed the database!

php artisan db:seed

Now we just have to create the settings and save them in the database.

php artisan settings:set

Congratulations! You just installed UrlHum.

📘

Admin user login details

UrlHum by defaults creates an user called Admin.
This user has admin privileges and can edit anything in the website.
The default login details are:
Email: [email protected]
Password: urlhum

Please be sure to change these login details after logging in. This is super important!

Great, you just finished installing UrlHum.
Play with it, and if you'd find any bug, please report it on the GitHub Issues Page