Installing nodeStorage on Ubuntu

Here's a checklist for installing nodeStorage on Ubuntu.

Install Node.js

sudo apt-get update

sudo apt-get install nodejs

sudo apt-get install npm

sudo apt-get install nodejs-legacy

We also install npm, a requirement to run Node apps.

nodejs-legacy makes it possible to run apps by saying node app.js instead of having to use nodejs, an oddity of Ubuntu.

Install git

sudo apt-get install git

I like to install git, because it makes it easy to install nodeStorage from GitHub.

Download nodeStorage

git clone

Install it

Change into the nodestorage directory you created in the previous step.

cd nodestorage

npm install

Create config.json

Launch your favorite Unix editor. I like nano because I'm a newbie, and it has a nice menu at the bottom of the screen if you don't know the commands.

nano config.json

Here's a template for config.json, copy the text, and paste it into nano in your terminal window.

Now I'm going to go through all the elements step by step, explaining what you have to do to set their values.

  1. enabled -- this one is easy, leave it at true.

  2. myPort -- enter the number of the port you want to use for nodeStorage. Make sure that this port is open in your firewall, if you have one on this server.

  3. myDomain -- enter a domain name that points to this server. If you don't have one, you can enter the IP address of the machine, it will work as well as the domain name (but it's not mnemonic, and it's hard-coded, so if you move your installation, you'll have to change your apps).

  4. where -- leave it as-is. It will store the public and private files in sub-folders of the nodestorage folder.

  5. basePublicUrl -- take the domain and port and use them to form a URL. Be careful not to put a trailing slash on the URL as shown in the example. It must be exactly the form specified above.

  6. twitterConsumerKey and twitterConsumerSecret -- I'll explain how to set this up in the next section. For now, leave them as set in the example. The strings are nonsense, just placeholders.

Save the file by typing Control-O, then exit with Control-X.

Launch nodeStorage

node storage.js

Set up your Twitter app

  1. Go to and click Create New App in the upper-right corner. A page with a form appears, asking for details of your app.

  2. You're probably configuring an app like MyWord Editor, but you have to call it something different. If it's for your book club, you could call it The Illium Book Club Blogs. If the name is already being used by someone, choose a different name. For my example I used "My test editor 2789". It was available.

  3. The website URL will depend on whether you're hosting the app or someone else is. Use the URL of the app that's going to talk to Twitter. Since I am just using MyWord Editor I just entered the URL for the app on

  4. The callback URL for nodeStorage instances is the url of the app, as specified by basePublicUrl in config.json, followed by "/callbackFromTwitter" (don't include the quotes).

As an example, here's a screen shot of the page I used to set up Little Pork Chop, an app that uses nodeStorage.

  1. If it all worked, you should have a Twitter app set up. Click on the Test OAuth button in the upper-right corner of the page, and it will show you two values, consumer key and consumer secret.

  2. In the terminal, press Control-C to quit nodeStorage.

  3. Open config.json in your editor, and replace the placeholder values for twitterConsumerKey and twitterConsumerSecret with these values and save the file.

Test your setup

  1. Go to MyWord Editor.

  2. Choose Switch Server in the Editor menu.

  3. Enter the URL you entered for basePublicUrl above.

  4. Sign on with the command in the rightmost menu.

  5. You should get the Twitter authorization page. Authorize your app.

  6. Enter a title, description and body.

  7. Choose View Story in the Publish menu. You should see the story.

  8. Look at your terminal. You should see various items in the log, showing MyWord Editor talking to your server.

  9. Pat yourself on the back. You are now a DevOps dudess or duderino. On your way to being a Full Stack Developer.

Last built: Sun, Mar 27, 2016 at 11:27 AM

By Dave Winer, Wednesday, August 5, 2015 at 11:02 AM. It's even worse than it appears.