Quickly Deploy LAMP Stacks with ServerPilot

Easily Deploy LAMP Stacks, and it’s free

I have yet to use ServerPilot, but will be setting up a new VPS at DigitalOcean in the coming weeks for a new venture. ServerPilot makes getting a LAMP stack setup very quickly.

ServerPilot will automatically install Nginx, Apache, PHP, and MySQL on a new, freshly installed/created, 64-bit Ubuntu 12.04 or Ubuntu 14.04. So if you’re using DigitalOcean, create your Droplet, and SSH to it. You should be able to harden SSH up a little, but make sure you don’t install any new packages yet.

Getting Started

Getting started with ServerPilot is crazy easy. All you need to be able to do is SSH into your server and run a command. I highly doubt anyone reading this doesn’t know how to do this. If you don’t, Google will tell you how.

1. Sign Up

Sign up for a free account with ServerPilot.

2. Connect A Server

“Connect” a new server. Just enter your servers hostname and click the “Continue With Setup” button. Screenshot below.
serverpilot-connect-server

3. Run The Install

Connect to your server via SSH. Remember, it must be a new server, preferably with no additional packages installed yet. To install Nginx, Apache, PHP, and MySQL, run the command below, from this gist:

The --server-id and --server-apikey values will be provided for you, they’re blacked out in the screenshot below.
serverpilot

Additional Information

On GitHub

ServerPilot also has a GitHub account with two repositories currently. One is ServerPilot/Vagrantfile and the other is ServerPilot/API.

ServerPilot/Vagrantfile

This repository provides a sample Vagrant configuration for testing ServerPilot. Basically a server that you can use to test ServerPilot before using it on a new, paid VPS. The README is very detailed, definitely read it if you need help using Vagrant. There’s even an example on using composer to create a Laravel app.

ServerPilot/API

From the README, The ServerPilot API is RESTful and allows you to manage ServerPilot resources using HTTP requests. All responses return JSON objects, including errors. As seems typical from ServerPilot, the documentation in the README is excellent.

The API will let you do things like list servers, connect new servers, or list all system users, among many others. An example that would list all servers can be seen in the gist below.

That request would return JSON similar to this:

Do you use Vagrant?

View Results

Loading ... Loading ...

Paid Accounts

You get a pretty cool monitoring dashboard for $10/month. I found the screenshot below in a post from Jake Peterson, it appears to be the ServerPilot monitoring dashboard.
serverpilot-dashboard
There’s the free plan, obviously, and then two paid plans. One is $10/month and the other is $49/month. You can see what you get for your money on their pricing page.

End

If you’re a PHP developer and use a VPS provider like DigitalOcean or Linode, ServerPilot is probably worth checking out. Even if you don’t end up using, it’s pretty neat that something like this even exists.

I only have one feature I’d really like to see, the ability to select certain packages to be installed. If that were included in the $10/month plan, I’d definitely do it. As it stands currently, though, it’s definitely a time saver and very well executed.

Host a Personal Data API on Heroku

Josh Beckman makes some pretty cool stuff. One of my favorite creations of his is Stark Lines. He’s also got a pretty neat API on his site that allows others to query it to get information about him. It’s at http://www.bckmn.com/api. Some of Josh’s JSON is generated on the fly with data from other API’s, and is built with Node.js.

You can make a similar API for your website really easily with a little PHP and Heroku. I put the whole thing up on GitHub so you can contribute (programming language examples especially) or totally make it your own.

I wanted to make it really easy for anyone to setup. You could get it setup with nothing but a text editor. Hosting your Personal API on heroku is quite nice as it provides great speeds and relatively good uptimes. Plus, if you’re a git fan, git push heroku master feels really good, lol.

Do you use Heroku for anything?

View Results

Loading ... Loading ...

Of course, there’s always some concerns.

1. A Standard

Ideally, every “personal site” with an /api URL or api.* subdomain should contain the same info, or MOST of the info, probably just the basics like name, age, langues, and location (maybe). If their was a standard it’d be very easy to grab info about LOTS of people, which may or may not be such a good idea. And that leads nicely to my next point

2. Privacy

There’s obviously some things you don’t want public, like your address and probably phone number. If you do implement a personal API like this, I suggest you modify the array to suit your needs. It’s extremely easy to edit, all it requires is a text editor, like Sublime Text. If there was a “Standard” personal API like mentioned above, it’s be very easy for attackers to just hit every website at /api or /api.php and pull down all the data.

Enough with concerns, gimme more

The benefits are pretty endless, especially depending on what kind of info your API provides. For example, people can fetch my name, employer, age, blogs, sites I run, generic family information and various other things. Authentication would be a good idea, too. You could provide relatively harmless info, like name and age, to the general public, but could require an API key to get even more JSON. That way, you could give friends and family access to more information.

Run It!

This is built to run on Heroku. Here’s a pretty basic way of deploying to Heroku.

  1. Fork tlongren/personal-api on GitHub and make a local clone.
  2. Install the Heroku Toolbelt and login to Heroku with the command “heroku login“. Enter your username and password to login with the Heroku Toolbelt.
  3. Create a new app on Heroku either through the web interface, or with the command “heroku create“. If you do it with the command line the app name will be shown to you, see here.
  4. Open a terminal and go into the folder that you cloned your fork into and run the command “heroku git:remote -a heroku-app-name“. That will add a remote named “heroku” to your local clone.
  5. Now, while still in your local clone folder, run “git push heroku master” to push your app to Heroku. If your app is named “heroku-app-name”, you can access your app at http://heroku-app-name.herokuapp.com.

And that’s all there is to getting setup with Heroku, a total of 5 steps, with just 4 simple commands.

See the GitHub repository for more info.

See any issues or have any concerns? Leave a comment below or at Hacker News.