OpenBazaar Server on a headless Ubuntu 12.04

OpenBazaar livenet is here, and I’m excited to get selling! I don’t have the greatest computer or internet, so I decided to run my OpenBazaar server not on my workstation, but on a dedicated computer in my basement. Here’s how to do the same on Ubuntu 12.04!

User

It is important to run openbazaar as a user other than root, since running it as root is a potential security risk. Create an ob user, which your openbazaar server daemon will run under.

Give ob user sudo access. If you know your stuff, you don’t have to do this part, but it’s easier to explain if ob has sudo access.

Create a password for the ob user. Make it a strong one and store it in a secure place.

Now we can switch to the ob user, using the password we just created.

We might not be in ob’s home directory, but that’s where we want to be, so run cd which will take us there.

Updates

Update package information, and Install important security updates for all your packages.

Dependencies

OpenBazaar server needs a bunch of things. It’s easy to install a majority of them in one go-

There are some dependencies that aren’t in Ubuntu’s repositories, but they are available through third parties who package the software for Ubuntu.

ZeroMQ development packages

Libsodium

ZeroMQ library packages

At this step, I encountered an error. All the tests from  make check  passed, but  make install  failed–

 

Python cryptography

 Download and Install OpenBazaar

using git, download the OpenBazaar server repository

Install the Python requirements that the OpenBazaar server needs. This step took about 7 minutes for me.

Create a python virtual environment from which your OpenBazaar server will run, then enter the virtual environment-

 

Install the OpenBazaar server Python dependencies-

There is a file in this OpenBazaar repository called ob.txt. This is the configuration file for our OpenBazaar server. We need to edit the file and set a username and strong password which we will later use to log into the OpenBazaar client interface. I use emacs, so I edit the file like this-

Use whatever text editor you’re most comfortable with. If you’re new to the Linux CLI, I recommend nano , which you would use like this:

Inside ob.txt, you’ll see a section called [AUTHENTICATION], like this-

Remove the hash signs at the start of the USERNAME and PASSWORD lines (uncomment), and set a username and password of your choosing. Your authentication section should end up looking like this:

Save the file and close your text editor.

Take a moment to install SSL using this guide. This secures the communication between your OpenBazaar server and your OpenBazaar client.

Running OpenBazaar Server

It’s time to start the server, but first a note about security. It is a good idea to restrict the IP addresses that can log in to your OpenBazaar server, since you are the only person who should be creating and publishing items in your store. The OpenBazaar server has a command line option for this, the  -a  flag. This tells the OpenBazaar server to only allow the following IP address to log in to your OpenBazaar server.

We will need to know the IP address of the client computer you will be connecting from. Since both my OpenBazaar server and client are on the same LAN, I just need to enter the LAN IP address of my client computer, 192.168.1.70.  If your server is on a VPS hosted by a cloud provider, you will need to enter your home router’s public IP address, which you can find here. That may be a problem though, since depending on your Internet Service Provider, your home router’s IP address may change over time. If that’s the case, you may need to skip this step and tell OpenBazaar to accept logins from any IP address, setting the -a flag to 0.0.0.0. A strong password changed regularly is very important!

Start your openbazaar server, specifying which IP address is allowed to connect and attempt log in. For me, I call it like this-

For you, substitute your home router’s WAN IP address, or use 0.0.0.0 to allow all IP addresses to connect and attempt log in-

welcome to OpenBazaar!

 

Leave a Reply

Your email address will not be published.