How to build and install Bitcoin on CentOS 7

The following instructions show you how to configure, compile, and install Bitcoin 0.9.4 on CentOS 7.

Update Your Operating System Packages

The first step is to always make sure your operating system and all of it's packages are up-to-date.

yum upgrade

Adding EPEL repository

Bitcoin requires a few libraries that are not provided by the default CentOS package repository. We could build these libraries from source but a better option is to use EPEL.

yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Installing Dependencies

The following packages are required to build and install bitcoin from source.

yum install autoconf automake gcc-c++ libdb4-cxx libdb4-cxx-devel boost-devel openssl-devel

Build and Install OpenSSL Required Dependency

Unfortunately the openssl thats provided with CentOS is lacking EC Libraries so we are going to have to download, build, and install a separate copy of OpenSSL

cd /usr/src
wget https://www.openssl.org/source/openssl-1.0.1l.tar.gz
tar zxvf openssl-1.0.1l.tar.gz
cd openssl-1.0.1l
export CFLAGS="-fPIC"
./config --prefix=/opt/openssl shared enable-ec enable-ecdh enable-ecdsa
make all
make install
 
===== Download, Build and Install Bitcoin  =====
Now we will download, extract, build, and install Bitcoin the source.  In this article we are downloading Bitcoin version 0.9.4
 
<code console>
cd /usr/src
wget https://github.com/bitcoin/bitcoin/archive/v0.9.4.tar.gz
tar zxvf v0.9.4.tar.gz
cd bitcoin-0.9.4
./autogen.sh
./configure --prefix=/opt/bitcoin PKG_CONFIG_PATH=/opt/openssl/lib/pkgconfig LIBS=-Wl,-rpath,/opt/openssl/lib
make
make install