So you want to deploy that app you made with Node? Well, DigitalOcean is one way to do it. They provide cheap, fast SSD-based virtual servers, or ‘droplets’, that you can spin up from their website. Their product is geared towards developers – they assume you have some proficiency with the command line and are comfortable configuring your own server. Most of what follows is adaptable to AWS, Azure, Heroku, and any other provider of virtual private servers.

A word to the wise: upgrading a DigitalOcean droplet is easy. Downgrading a droplet is hard. If you aren’t sure how much space / memory / transfer you will need, start small and move up later.

I’ll keep this tutorial brief and assume you have a minimum of experience with servers. This setup works well for small apps with light traffic and storage requirements – essentially, the kind of apps you might build as proofs of concept while learning web development.

Create an account with DigitalOcean.

Log in and click Create Droplet.

Select ‘Ubuntu’ at the current highest x64 version. Select the the size you’re comfortable with – remember, if in doubt, start small. Add block storage if you need it, and select a datacenter close to where your users are. Select additional options if you want – most often, backups are a good idea and worth the extra investment.

If you don’t have an SSH key set up yet, it’s a good idea to set one up by clicking New SSH key, and following step 1-4 of the SSH key directions. This prevents you from receiving the root password via email, which is not very secure.

Unless you have reasons to make duplicate droplets, leave the number set at 1. Give your droplet a hostname, and click Create.

Wait while the droplet is created. When it’s ready, you’ll see your IP address – write this down for future use with SSH access in step 9.

Follow the steps in these tutorials to configure your server: Initial Server Setup with Ubuntu 14.04, then Additional Recommended Steps for New Ubuntu 14.04 Servers. This will help you set up SSH access by setting up a non-root user, disabling root access for enhanced security, configuring SSH access, creating a basic firewall, and configuring the time zone. Don’t do the steps for Create a Swap File – you’ll see that this is not recommended for SSD-based servers like the one you just created. Do follow through with taking a snapshot of your current configuration so you can clone your server from this point next time you’re setting up an app. You may want to wait and do this after you follow the next step, so that your snapshot is ready to go with Node installed.

Next, you’ll need to copy your app’s files from your local machine to your server. You have several options here:

Use SCP from the command line. You’ll want to copy files into your home directory – this directory should have the correct permissions set to allow you to remotely add files. Run this from your local terminal – the sudo password here is your local password, path-to-local-site-root is where your site folder lives on your local machine, your-ip-address is the IP from step 6, user is the username you created in step 7, and site is the name of your remote site folder.

Start up that Node server! Check out my post Keep Node running forever for details on this. Note that you will need to navigate to your server folder, which is somewhere within /home/user/site before you run Node. Once you start Node, you should be able to open your IP address in the browser and see your site.

If you’ve ever started up a deployed Node application, you’ve probably had this problem: you start the server with node server.js, check on your site, and it’s up and running. Great! Some time later, your SSH session times out or you close your terminal. Then you go to your site, and it’s down. What happened?

You ran the server in the foreground, which means that when you log out of SSH, it will be stopped along with all the other running processes.

I’ve found two good solutions. Before using either of them, make sure you are starting the server with root privileges by running sudo -i. This will take you to the root of the server, so you will need to cd back to the folder where the server file is located.

Method 1: Run node in the background

In this method, you start Node with the & flag to run it in the background and the nohup flag to detach it from the console window.

Last night, I went to a meetup at Slack on the Microsoft Bot Framework. It was a good opportunity to get a grasp on what the Bot Framework is, and how developers are using it to create bots that deploy on several different channels, including (as of March 2016):

Text/SMS

Office 365 mail

Skype

Slack

GroupMe

Telegram

Facebook Messenger

Kik

Web (via the Bot Framework embeddable web chat control).

The general idea is that you can write a bot in the Microsoft Bot Framework, and it will be portable to all these channels, with some slight modifications depending on the specifics. Great! But what is a bot, anyway?

Generally, a bot embodies some kind of AI, or artificial intelligence. It’s an app that acts like a person, and it helps you accomplish work by using contextual meaning. If you’re an iPhone user, you’re familiar with Siri. Siri is essentially a bot – it asks you questions and accomplishes some kind of work by reasoning about your answers. Here’s a screenshot from the Bot Framework splash page:

Mat Velloso gave the presentation, and one example he gave is called Murphy. You ask Murphy any kind of ‘what if’ question, and it goes out and finds images that match your scenario, then mashes them together. Basically, it’s face swap via bot. You can say ‘what if I were the president?’ and Murphy will probably give you an image of President Obama with your face. This is a rudimentary example, but you can see how bots would make lots of things faster, especially on a mobile device. You can give short, partial answers and depend on the natural language processor to figure out what you mean.

The SDK, available on GitHub, is written in C# and Node.js. You can fork the repo and start working from examples to build your own bots. Here are a few more resources that were covered during the presentation: