How to Install: Digital Ocean LEMP Stack

Quickly set up your help desk on a Digital Ocean droplet

This article is in progress...

Create a new Droplet

Go to the LEMP stack page in Digital Ocean Marketplace, then click on the Create LEMP Droplet button

Choose the Plan that best fits your needs, any plan will work with your application

Choose the Datacenter region closest to you and your customers

Select the most appropriate Authentication method

You will be using this authentication method to get access to your Droplet console. If you have an SSH key, simply select it or upload it by clicking on the New SSH Key. You can also select the One-time password option if you don't want to use SSH. SSH is recommended as it provides an easy way of transferring files between your computer and your server.

To finalize your Droplet configuration, choose a hostname that makes sense to you. You can keep the default value, or change it to something like "helpdesk" or "desk.example.com", where "desk.example.com" is the domain name you will be using to log in as a support agent.

Review the configuration and click the Create Droplet button once you are ready. Feel free to tweak the configuration as needed before proceeding.

Install required extensions

Open your favorite terminal and SSH or login to your Droplet. Once you are in, copy the following command and execute it within your droplet terminal:

apt install php7.2-intl php7.2-mbstring php7.2-dom php7.2-xml php7.2-zip php7.2-bcmath unzip

Create a database and database user

Once the extensions are installed, create the database and database user you will be using for your application. To do so, log in to your mysql server by executing mysql -u root, or sudo mysql -u root. Feel free to change root with another existing mysql user. Once you have logged in to the mysql terminal, run the following commands, one by one:

create database fullhelp;
CREATE USER 'fullhelp'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'fullhelp'@'localhost';
FLUSH PRIVILEGES;

Adjust the database name and user as needed. Make sure to change 'password' with a strong and secure password. You will be entering these values in the application installation wizard.

Once the database and user are created, exit the mysql terminal.

Create the application directory structure

Run the following command to create the directory where your application will be located:

mkdir -p /var/www/fullhelp/live

Upload your application

Below are the instructions for SSH and One-time authentication methods. Use the authentication method you selected during the droplet configuration.

SSH

Exit from your current terminal session (or use a new terminal session) and authenticate by using the following command:

sftp [user]@[server ip]

Where [user] and [server ip] are the same you used the first time you logged in to your server.

Once you are in, run cd /var/www/fullhelp/live, this will set /var/www/fullhelp/live as our server's working directory. To upload the files, simply run:

put /v0.0.0.zip

Where /v0.0.0.zip is the path to the application zip file (in your computer) you downloaded from www.fullhelp.com. Replace v0.0.0.zip with the application version you downloaded. For example, if you downloaded v0.9.0, replace v0.0.0.zip with v0.9.0.zip.

Once the zip file is uploaded, it is time to unzip it. To do so, exit from your current sftp session and SSH to your server, once in, navigate to /var/www/fullhelp/live and run unzip v0.0.0.zip. Again, replace v0.0.0.zip with the application version you are using. For example:

cd /var/www/fullhelp/live && unzip v0.9.0.zip

Configure Nginx

There will be an Nginx starter configuration file in the application's root directory (i.e., /var/www/fullhelp/live/server.nginx.conf), simply copy the content and paste it in a new configuration file in /etc/nginx/sites-available. Or simply run the following command to copy the file:

cp /var/www/fullhelp/live/server.nginx.conf /etc/nginx/sites-available/fullhelp.conf

Open the configuration file and adjust it so it fits your needs. Make sure to replace "desk.example.com" with the domain name you will be using to access the help desk agent dashboard. This domain will not be used by your customers, only your support agents.

As for knowledge base accessibility, things get a bit more complicated. Since we don't want to be changing Nginx's configuration file each time a new knowledge base is created (or updated), we will be using a wildcard/expression-based server-name so new domains are mapped to the application dynamically. Of course, if you are not planning on creating multiple knowledge base sites frequently, you can change this with a static domain, like docs.example.com.

Let's assume you want to serve your knowledge base sites under *.acme.com, where * is the subdomain of each knowledge base site and acme.com is your base domain name.

In the configuration file, simply change ~^(.*)\.example\.com$ with ~^(.*)\.acme\.com$, and you are ready to go. If you want to use a subdomain instead, like *.sites.acme.com, replace ~^(.*)\.example\.com$ with ~^(.*)\.sites\.acme\.com$.

Note: Make sure to adjust the configuration file as needed. For example, if you are using a different PHP version (other than php 7.2), or a different application root path (other than /var/www/fullhelp/live/public).

Once you finish working with your configuration file, enable it by executing the following command:

ln -s /etc/nginx/sites-available/fullhelp.conf /etc/nginx/sites-enabled/fullhelp.conf

Next, execute nginx -t to make sure there are no errors. If everything looks good, restart your nginx server so the new changes take effect:

service nginx restart

Application install wizard

Head up to your application domain name and proceed with the install wizard.

Your vote was sent, thanks!
Was this article helpful?

Want to talk to a human?

Feel free to contact us if you cannot find what you are looking for in our help center. We will be answering you shortly!

Feel free to contact us if you cannot find what you are looking for in our help center. We will be answering you shortly!

Contact us
Woman messaging on mobile phone