Installing OpenBazaar

OpenBazaar is a peer-to-peer and decentralized marketplace that allows you to buy and sell anything using Bitcoin. Think eBay, Taobao, Shopify or Etsy, only free! There are no listing fees and no transaction fees. Can buy or sell physical goods, digital content, and even services off OpenBazaar.

1.0 Getting Started

If you want to start using OpenBazaar, you should download one of our Windows, Mac, or Linux installers here.

When you first run OpenBazaar, you'll need to go through onboarding.

1.1 Onoarding

Unlike most platforms, you don't need to surrender any personal information. Rather, you have complete control how much you want to share with the rest of the network.

Step 1: Select Your Language

Please note that some languages will only have partial translations and are a work in progress.

Step 2: Introduction

Some nice info here for you.

Step 3: Select Your Country

This will help indicate what listings are able to be shipped to you.

Step 4: Select Your Currency

This will demonimate prices in your selected currency. Even though all trade is in Bitcoin, OpenBazaar can convert prices into the currency of your choice.

Step 5: Select Your Time Zone

Synchronize to your local time.

Step 6: Set Your Information (optional)

You can set your name and description here if you desire to do so. You don't have to put your real name. You can also select whether you want to see not suitable for work (NSFW; 18+) listings.

Step 7: Theme

Select a theme for your Page. Every node has a Page, and you can put as much or as little information in that as you want.

Step 8: Avatar (optional)

Create an avatar for your node, if you want.

Step 9: Recommended Pages to Follow (optional)

You can discover new content from people you follow or randomly from the network. Selecting these recommended nodes will get you started following the official OpenBazaar node among other others.

Step 10: Disclaimer

Important information before you start.

1.2 Exploring OpenBazaar

After you finish on-boarding, you'll see your Page.

From your page you can become a store, customize your Page, or follow the prompts to enter the Discover page to find what listings are for sale in OpenBazaar.

1.3 Discover

When you enter the Discover page, you can randomly view listings from nodes that you follow in the 'Personalized' tab. If you followed the suggested nodes during on-boarding, you will see some listings there.

To explore OpenBazaar as a whole, select the 'Random' tab, which will display listings from nodes that you are randomly connected to.

2.0 Virtual Private Server (VPS)

If you want to start selling, you can also download the installer, but you'll have to have your desktop/laptop running OpenBazaar 24/7 to make your listings available. If you want to run OpenBazaar 24/7, then you should probably install OpenBazaar on a virtual private server or VPS.

While this sounds complicated, we've tried to it as easy for you as possible. This article contains a number of different ways to you can get started with OpenBazaar by manually installing it on a VPS.

You should know...

OpenBazaar the application is actually a combination of two components: the client and server. The client is what you will interface with, and the server is the networking & database backend. Please don't be confused by the terminology 'server', it just means this is the part of the OpenBazaar application that communicates with the rest of the network.

2.1 Amazon Web Services (AWS)

One of our community members has made a step-by-step guide to install your OpenBazaar server component on an Amazon AWS instance.

What's great about this approach is that Amazon lets you use their smallest VPS for free for 1 year! What's even better is that OpenBazaar runs on this just fine.

2.2 Vultr

Another one of our community members has created a video tutorial for setting up OpenBazaar on the Vultr VPS service (they accept Bitcoin too).

2.3 Digital Ocean

Digital Ocean has some great options and is an easy, user-friendly platform to create and install OpenBazaar. Unlike AWS, their service isn't free, but their smallest plan costs $5/month.

The guide below also doubles as a way to install OpenBazaar from source in Ubuntu 15.10.

Step 1: Sign up for a Digital Ocean account and Create a Droplet

  • Visit the Digital Ocean website and sign up. You can then choose to create a droplet (their term for a VPS).
  • Choose Ubuntu 15.10 x64 with a $5/month plan. It should look like this:
  • Choose the datacenter region of your preference (choose something close to your location if you want to optimize for speed). You don't need to choose any additional options.
  • You can add a SSH key if you like. This makes logging into your VPS easier and more secure in the future. If you don't add a SSH key, it will login with a password instead. If you don't know what an SSH key or how to use one, ignore this.
  • You can now choose any hostname (e.g. myshop) you like and hit "Create."

Step Two: Use SSH to communicate with your new VPS

  • Once the droplet is created you will receive an email which gives you three important things:
  1. The IP Address of your VPS
  2. Your username (default is root)
  3. Your password
  • Now you need to log in and communicate with your VPS. This is done using a protocol called SSH.
  • For Linux and OS X users SSH is supported in terminal itself. Windows users will need to install a new program called Putty.

SSH with Linux and OS X

  • Open your terminal. Use Ctrl+Alt+T for Linux users and use Spolight search for "terminal" in OS X.
  • Now you enter a command to connect to your VPS (note that throughout this guide when you see [ ] brackets you don't type those in):
    • ssh root@[VPS-IP-Address]
    • [Note that later you will not use root to login, but another username.]
  • After the @ symbol you put in the IP address you received in that email.
  • Since this is the first time you've connected to this address, you'll receive a warning:
The authenticity of host '[IP address]' can't be established. Are you sure you want to continue connecting (yes/no)?
  • Ensure you've got the right IP, then type 'yes'.
  • It will now prompt you for a password; enter the password from the email. If successful, it will now ask you to create a new password.
    • You'll need to re-enter the original password, then enter a new one twice.
    • Make sure you use a strong password! Anyone else could take over your OpenBazaar server if they guessed your password and gained access to your VPS.
  • You're now connected to your VPS and can control it through this terminal.

SSH with Windows

  • There are multiple SSH clients you can use with Windows. One open-source program with a good reputation is called Putty. You can find a download here.
  • To make a SSH connection, put the IP address you received in the email into the "Host name (or IP address)" field and leave it on port 22.
  • A window will pop up asking you "login as:" and you type 'root'. [Note that later you will not use root to login, but another username.] Then put in the password you received in the email.
  • If successful, it will now ask you to create a new password.
    • You'll need to re-enter the original password, then enter a new one twice.
    • Make sure you use a strong password! Anyone else could take over your OpenBazaar server if they guessed your password and gained access to your VPS.
  • You're now connected to your VPS and can control it through this terminal.

Step Three: Create a new user to avoid using 'root'

  • Now you're logged into your VPS via SSH and are at 'root.' Root access means you can make any changes you want to the computer. That sounds like a good thing, but it's actually a bad idea to use root to run your OpenBazaar server.
    • If something goes wrong you could accidentally mess the VPS up and your server with it. It's much better to create another user within your VPS and use that account to run the server.
  • Type the following command into the terminal, replacing 'username' with an easy to remember name of your choice:
    • adduser [username]
  • It will ask you for new passwords (you can use the same password as root if you like, just make sure they're strong) and also ask for more information about the user (you can just hit enter to skip).
  • Once that's complete, you need to give the new user the ability to use sudo, which is a command that allows you to make changes to your installation. To do this, type in:
    • visudo
  • You will now see text in the terminal which you can edit. Scroll down with the down arrow until you see a line that reads:
    • root ALL=(ALL:ALL) ALL
  • Directly underneath that line add a new line that starts with the new username you created and replicates the rest of the 'root' line above:
    • [newusername] ALL=(ALL:ALL) ALL
  • Now save your changes by hitting Ctrl+X, confirm by typing Y (or yes) and then hit enter.
  • You can now exit this SSH session in order to log into your new username. For Linux/OS X this means you use the following command:
    • ssh [newusername]@[VPS-IP-Address]
  • For Windows, when you receive the "login as:" prompt you put in the new username instead of root.

Step Four: Install OpenBazaar Server

  • Log into your VPS under your new username. You're now ready to install the OpenBazaar server.
  • To make the installation process as easy as possible, we've created some installation scripts for you to use:

Create the Installation Script

  • Install nano, a terminal-based text editor:
    • sudo apt-get install nano
  • Select the directory you want to create the installation script. If you have freshly logged into your VPS, you're probably in the /home/[username]/, which is fine. Now we'll create the installation script:
    • sudo nano install.sh
  • This will open nano, where you'll paste in the following installation script. Copy the script below and paste it in (use Shift+Insert to paste):
#!/bin/bash

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install git
sudo apt-get install build-essential libssl-dev libffi-dev python-dev openssl python-pip libzmq3-dev
sudo echo "deb http://us.archive.ubuntu.com/ubuntu vivid main universe" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get -f install
sudo apt-get install libsodium-dev
sudo pip install cryptography
sudo apt-get install autoconf pkg-config libtool
(cd /$HOME/; sudo git clone https://github.com/zeromq/libzmq)
(cd /$HOME/libzmq; sudo ./autogen.sh && sudo ./configure && sudo make -j 4)
(cd /$HOME/libzmq; sudo make check && sudo make install && sudo ldconfig)
(cd /$HOME/; sudo git clone https://github.com/OpenBazaar/OpenBazaar-Server.git)
(cd /$HOME/OpenBazaar-Server; sudo pip install -r requirements.txt)
  • It should look something like this:
  • Save (Ctrl+O) and exit (Ctrl+X).
  • Give the script executable permissions: sudo chmod +x install.sh

Install OpenBazaar

  • Run the installation script you just created (you'll have to press y in a couple of places):
    • sudo bash install.sh

Setup OpenBazaar

  • The script will have created an OpenBazaar-Server folder. Navigate to this folder by typing: cd /home/[username]/OpenBazaar-Server
  • To access your OpenBazaar node remotely, you'll need to change the default username and password. To do this, type:
    • sudo nano ob.cfg
  • Now you need to use the down arrow on your keyboard to move down until you see a section that shows a username and password, as shown below:
  • Note that both username and password have #'s at the beginning; those must be removed.
  • After removing the #'s before USERNAME and PASSWORD enter in your own username and password as shown below.
  • Save (Ctrl+O) and exit (Ctrl+X).
  • Your OpenBazaar node is now setup and ready to run!

Step 5: Setup SSL

  • SSL makes the connection from the remote server to your client computer more secure. It's not necessary to enable in order to connect to your server, but it is highly recommended because it's insecure otherwise.
  • This guide explains how to set up SSL with your remote server.

Step Six: Start the Server

  • To run your OpenBazaar node, make sure you're in /home/[username]/OpenBazaar-Server/, and then type in:
    • sudo python openbazaard.py start -da 0.0.0.0
  • This command (-d) runs OpenBazaar as a background process that keeps running after you logout of your VPS (no need to use cron or anything else to keep it alive).
    • You won't see any terminal output other than OpenBazaar is starting.
  • OpenBazaar will also be remotely accessible from any IP address (-a 0.0.0.0), which takes into account that your IP address may change all the time (especially if you're using a laptop).
    • Please note that no one can access your node without the username and password you created in Step 4.
  • You can now exit your VPS, as your OpenBazaar node is now running and connected to the network.
    • Please note that the first time your run the node, it may take a few minutes to generate your unique OpenBazaar crytographic identity.
  • If you need to top the server, type:
    • sudo python openbazaard.py stop
  • After you stop the server, you can update it to the latest code by typing:
    • sudo git pull

3.0 Connect to your OpenBazaar VPS Node

  • There are 2 ways to connect to your OpenBazaar VPS node:
    • Download the installer and setup the connection to your VPS node
    • Install the client from source
  • If you use the installer, you can easily setup a new connection to your VPS node.
  • First you'll have to setup a local node and go through on-boarding, which you can use to make purchases for example.
  • Once you have setup your local node, select the Menu button and 'default':
  • Next, select 'New Server'.
  • Add in the following data:
    • Name. What you want to call this configuration.
    • Server IP. The IP address of the VPS hosting your OpenBazaar node.
    • Username. The username you set in the ob.cfg file in section 2.3
    • Password. The password you set in the ob.cfg file in section 2.3
  • Press the SSL button if you have enabled SSL for your node.
  • Click 'Save Changes' and you should automatically connect to your OpenBazzar VPS node.
  • If you want to install the OpenBazaar client from source, the next section will guide you how to set that up for your operating system.

4.0 Install From Source

Some of you may want to run OpenBazaar using the latest code, which means installing from the source code. This is much trickier to do and only recommend it if you know what you're doing. Since the VPS instructions are installing from source on Linux, below are instructions for installing on Windows and Mac OSX.

4.1 Windows

You will need some basic knowledge of the command line to do this. You can easily access the terminal/command line from Windows Explorer within a desired location of interest if you type in cmd in the address bar.

I am also going to assume you have installed git, python 2.7 and pip into your computer and added them to your $PATH.

Install Dependencies for the OpenBazaar Server

Install Dependencies for the OpenBazaar Client

4.2 OSX

Install Dependencies for the OpenBazaar Server

  • Install Xcode command line tools
    • Open the terminal and type: xcode-select --install
  • Install homebrew
    • ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    • brew update
    • brew doctor
  • Install git, libffi, openssl, and python
    • brew install git
    • brew install openssl
    • brew install libffi
    • brew install python
  • Install cryptography library (El Capitan)
    • sudo env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography

Install Dependencies for the OpenBazaar Client

  • Install Node
    • brew install node
  • Install npm
    • brew install npm

4.3 Linux

The instructions for installing OpenBazaar-Server in Linux are identical to setting a node up on a VPS. However, there are unique installation scripts depending on the version of Ubuntu or Debian that you are running, which you can find here.

Install Dependencies for the OpenBazaar Client

4.4 Install the OpenBazaar Server (all OS's)

  1. Install OpenBazaar server repository somewhere on your computer
    1. Note: if you ran the script above, you do not need to do this step.
    2. git clone https://github.com/OpenBazaar/OpenBazaar-Server.git
    3. Navigate to the newly created OpenBazaar-Server folder
      1. cd OpenBazaar-Server
    4. Install other dependencies
      1. pip install -r requirements.txt
      2. Lookout for potential errors; if there are, go to our #installation-issues channel on the OpenBazaar Slack so we can help you
        1. Rerun this command if you had to fix any bugs
  2. Setup authentication
    1. Open the ob.cfg file in the OpenBazaar-Server folder
      1. If you only have a terminal if you're using Linux, you can open it using nano (if you don't have it, sudo apt-get install nano)
        1. nano ob.cfg
      2. Scroll down until you find these lines:
        1. #USERNAME = username
        2. #PASSWORD = password
      3. Remove the # in front of USERNAME and PASSWORD
      4. Change the username and password to whatever you want, for example:
        1. USERNAME = drwasho
        2. PASSWORD = password
  3. Run the server
    1. python openbazaard.py start
    2. Other flags you may want to use:
      1. -d (daemon) runs the server as a background process
      2. -a allows you to permit a specific IP address to make REST andWebsocket API calls
        1. If you want to make your server accessible from anywhere, set the ip address to 0.0.0.0
        2. The server can only be accessed with the proper authentication settings, which you should have set in Step 5!
      3. Example of how I run my node: python openbazaard.py start -da 0.0.0.0
    3. If you want to stop the server, you need to open a second terminal at the server's location (if the server isn't running in the background) and type: python openbazaard.py stop
      1. This shuts down the server properly and you won't get any weird connectivity issues if you try to start the server again immediately
      2. You can also restart the server with: python openbazaard.py restart

4.4 Install the OpenBazaar Client (all OS's)

  1. Clone the client repository into a directory of your choice
    1. git clonehttps://github.com/OpenBazaar/OpenBazaar-Client.git
  2. Navigate into the new folder you just created
    1. cd OpenBazaar-Client
  3. Install the client
    1. npm install
  4. Run the client
    1. npm start
    2. The OpenBazaar server must be running for the Client to work properly. It will start by searching for the server running onlocalhost.
    3. If it fails to connect, a modal will pop-up allowing you to change the location of the server (if not localhost), ports (you shouldn't have to change these), and the username & password.
      1. Make sure that the username and password match what you entered in ob.cfg
    4. If you are running the server for the first time, it may take a minute or so to connect as the server is generating a GUID (OpenBazaar address). Be patient!

4.5 Updating the Server and Client Components

  • Make sure the server or client are shutdown
  • Open the terminal and type git pull in the OpenBazaar-Server orOpenBazaar-Client folders
  • Check for regular updates on a daily basis

4.6 Setup SSL

  • Instructions can be found here: https://slack-files.com/T02FPGBKB-F0XK9ND2Q-fc5e6500a3.
  • Warning: without an SSL connection to your remote node, you are vulnerable to MITM attacks and your authentication details are unencrypted. Do not run a remote node without SSL enabled!

Happy Bazaaring!