Hosting Websites on Bare Minimum VPS/Dedicated Servers

How to Use ServerPilot to Manage Your Server

In this tutorial, you will learn how to manage any server running Ubuntu (18.04 / 16.04) with ServerPilot.

Founded in 2012, ServerPilot is one of the most established hosting control panels around, and their specialty is in helping you host popular PHP-based apps and frameworks such as WordPress, Magento, and Laravel.

ServerPilot isn’t only an easy way to manage your server from the cloud, but it’s also highly tuned for performance, with out-of-the-box configuration of Apache with Nginx as a reverse proxy. In addition, it simplifies the work of setting up multiple PHP versions, SSL for HTTPS, and the newest Internet protocol, HTTP/2.

Compared to other more conventional control panels like CPanel, ServerPilot doesn’t weigh your server down, as it is not a monolithic piece of software sitting on your server, but instead uses a lightweight agent (called sp-agent) to relay commands from your control panel in the cloud.

Requirements

  • A new Ubuntu 18.04 (or 16.04) 64-bit VPS or dedicated server at any provider, with at least 256 MB RAM. Only Ubuntu must be installed (no Apache, MySQL, or other packages).
  • Some cash – i.e. PayPal or Credit Card, because ServerPilot’s free 14-day trial is severely limited. The most basic paid plan is called Economy and costs $5 / month per each server, plus $0.50 / month per each app you run.
  • If you need to run email accounts with inboxes, you will need a separate mail server to handle this because ServerPilot only permits sending outbound emails from your app and doesn’t let you create or manage email accounts.

Step 1: Create a ServerPilot account

This is easy enough. Open an account and load credit for 1 server and 1 app, or however many you need.

If you only want to try ServerPilot, take note of the features that are not available on the 14 day trial:

  • Multiple apps.
  • Automatic free SSL certs.
  • Server usage stats.
  • App usage stats.
  • Log file viewer.
  • API usage.

In fact, some of these features (e.g. usage stats and logs) are only available with the Business plan, which costs $10 / month. If you’re on the Economy Plan and you can’t live without logs, you can bypass this limitation manually by viewing your logs with SSH or SFTP.

Step 2: Connect your server

Connect your server to ServerPilot by filling out your server IP and root password, and selecting an appropriate plan.

When you click Connect, ServerPilot will install sp-agent on the server, which has full root control to correctly configure your server and manage everything for you going forward.

Here is what sp-agent does behind the scenes of the automated setup process:

  • Configures the iptables firewall.
  • Updates all necessary server packages.
  • Installs Apache2.
  • Configures Apache2 with .htaccess and mod_rewrite support.
  • Installs Nginx and configures it as a reverse proxy.
  • Installs MySQL server.
  • Installs Postfix MTA and configures it so apps can send outbound mail.
  • Enables automatic package updates and system clock updates.
  • Installs PHP 5.6 through to 7.3 using PHP-FPM.
  • Configures stats and logs for the server and apps.
  • Enables swap space.
  • … And a few extra things.

Troubleshooting: If installation fails to start, you may have entered the wrong root password, or your server isn’t configured properly for SSH. Make sure that you have not disabled root login on the server, and that the SSH port is set to 22. Log in with SSH, then open the file at /etc/ssh/sshd_config and change the relevant options if needed. If nothing works, try reinstalling Ubuntu 18.04 again from scratch – the fresh default options will be correct.

Step 3: Create and run your app

So what apps can you run with ServerPilot? The short answer: any web app written in PHP, from PHP 5.6 to PHP 7.3 and everything in between. WordPress is the only app with an automated installer on ServerPilot, yet the steps to add any new PHP app are mostly identical.

First, click Create App and fill out the form.

  • Name: What is your app / website called? For dashboard use, so choose anything you like.
  • Domain: The domain name you will use to access the app.
  • Server: Leave as default, since there’s only one server at the moment.
  • Runtime: Unless you’re running legacy code, choose PHP 7.3.
  • System User: You will use this user to log in with SFTP to upload files.
  • System User Password: Something with lots of stars like this ****************.

Now, go to your domain registrar and set your domain’s DNS host records to point at your server IP. A typical DNS configuration consists of these two basic fields:

  • An A Record with Host set as “@” and Value set to your server IP.
  • A CNAME Record with Host set as “www” and Value set to your domain name with a full stop at the end: e.g. “com.“. This redirects www.example.com to example.com.

Once you’ve set these DNS host records, you can type the domain name into your browser and you will see the greeting:

Great, it’s working! Here’s a short list of PHP apps you can now upload via SFTP and install:

  • WordPress
  • Joomla!
  • Drupal
  • Magento
  • Laravel
  • Nextcloud / ownCloud
  • … And many others.

After you’ve uploaded your app’s files using SFTP as your System User, you must create a database for the app. Simply click on Databases in the ServerPilot dashboard and choose your database credentials.

Keep these credentials at hand while following the installation instructions for whichever app you want to install.

Finally, add a free SSL certificate with ServerPilot’s AutoSSL by going to SSL in your ServerPilot dashboard. It takes one click and it’s done.

Once SSL is enabled, you may also want to click “Redirect HTTP to HTTPS”, so that all visitors will be redirected to the secure HTTPS version of your site every time they access it.

Step 4: Security

Security is always a concern when you entrust your server’s maintenance to a third-party. Fortunately, ServerPilot has a team of security-conscious developers who adhere to best practices and are actively involved in security research.

For a breakdown of ServerPilot’s main security measures, see ServerPilot Security. The TL;DR (Too Long; Didn’t Read) is that you don’t need to do anything further to secure ServerPilot manually.

Step 5: Backups

ServerPilot doesn’t manage your backups for you, so you will need to ensure backups are being done at your VPS hosting provider. Take some time now to configure weekly or monthly backups (or snapshots) of your server so that you can revert back to a safe working version at any time.

No Comments

Leave a Reply

Some notes on commenting on LowEndBox:

  • Do not use LowEndBox for support issues. Go to your hosting provider and issue a ticket there. Coming here saying "my VPS is down, what do I do?!" will only have your comments removed.
  • Akismet is used for spam detection. Quoting webhostingtalk.com URL seems to get binned consistently here, but I do peek into the spam box frequently to publish those comments.
  • Use <pre>...</pre> to quote the output from your terminal/console, or consider using a pastebin service.

Your email address will not be published. Required fields are marked *