How to install a Bitcoin client on Ubuntu Server

7

4

I've googled a lot for this issue. Hehe. I have found some tutorials, but they were of no use because they are for systems that do have a GUI. I have no plans to install a GUI on that system, and I want to use bitcoin from the command line, or via RPC API. This is the system I run:

Linux redacted 3.2.0-40-generic-pae #64-Ubuntu SMP Mon Mar 25 21:44:41 UTC 2013 i686 athlon i386 GNU/Linux

I found I can do this:

sudo apt-get install bitcoind

But hardly I know what to do with it after that. It installs successfully. If you are going to ask a reason why I want this, it's because I want to communicate with it via PHP or I'll see how, but mostly it's for automating services with it. Please help. :-(

ParanoidE

Posted 2013-04-20T00:32:49.047

Reputation: 101

When installed, can I use the client for getting payed on apache (php or tomcat) web pages? – Pascal Fares – 2013-12-17T13:59:51.143

1

If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context.

– Murch – 2013-12-17T23:30:42.953

Answers

9

Once you've installed bitcoind, you should create a configuration file (stored in ~/.bitcoin/bitcoin.conf) containing at least an RPC username and password, and then you just run bitcoind to start the server.

Tom van der Woerdt

Posted 2013-04-20T00:32:49.047

Reputation: 2 417

Thanks! I'm checking right now how can I add it to system startup. – ParanoidE – 2013-04-20T16:07:34.263

6

Edited answer after Tom van der Woerdt's comment about using an untrusted repo

from: https://gist.github.com/WyseNynja/2503687

sudo apt-get update
sudo apt-get install -y git-core build-essential libssl-dev libboost-all-dev libdb5.1-dev libdb5.1++-dev libgtk2.0-dev

git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin/src

make -f makefile.unix clean; make -f makefile.unix USE_UPNP= bitcoind

# from #bitcoin-dev:
# sacarlson: USE_UPNP= : don't build upnp, USE_UPNP=0 : build but disable by default, USE_UPNP=1 : build but enable by default

# optionally, 
strip bitcoind

download blockchain (check against http://blockexplorer.com/q/getblockcount):

bitcoind

test bitcoind:

bitcoind getbalance
bitcoind getaccountaddress account #(where account is the rpcuser account you created earlier in your bitcoind.conf file.) It will look like this: 1djfdLXSgqrwtexqkn9JewSrCJU4vu74eR4

send coins to the address and doublecheck bitcoind getbalance

John

Posted 2013-04-20T00:32:49.047

Reputation: 539

Baaaad idea. Untrusted repo, while the default ones have it too. – Tom van der Woerdt – 2013-05-13T19:11:52.387

I don't think this is correct. Can anyone else confirm this, because the INSTALL file tells you to install using ./autogen.sh && ./configure && make – puk – 2013-12-04T23:01:05.477

After cloning a repo, for reliable operation, you should git checkout the current stable release version. – Willtech – 2018-02-03T07:56:00.453

0

I already posted this answer, but it's gone for some reason. If some moderator deleted it, then I am ok with it, but shame on them for not informing me. In any case, here is the shell script I run on my computers to get bitcoin up and running:

#!/bin/bash

# Word of caution, I am not an experienced shell programmer. All I can #
# guarantee is that this script has worked for me, and that it has     #
# done so on multiple Ubuntu machines (one 11.10 and one 13.10), so    #
# hopefully it will work for you too                                   #

# Install some packages as instructed on various web sites
sudo apt-get -y install qt4-qmake libqt4-dev build-essential libboost-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libssl-dev
sudo apt-get -y install libtool autotools-dev autoconf
sudo apt-get -y install libdb4.8-dev     # Generally this step fails
sudo apt-get -y install libdb4.8++-dev   # Generally this step fails
sudo apt-get -y install libboost1.37-dev # Sometimes this step fail
sudo apt-get -y install libboost-all-dev # Sometimes this step fail
sudo apt-get -y install libminiupnpc-dev
sudo apt-get -y install libdb++-dev
sudo apt-get -y install libprotobuf-dev
sudo apt-get -y install libqrencode-dev


# Build berkley db4.8
# Technically, this should only be installed if the above              #
# libdb4.8XX-dev packages failed to install but nothing beats a little #
# overkill =)                                                          #
cd ~/Downloads

if [ ! -e db-4.8.30 ]
then
   wget http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
   tar zxvf db-4.8.30.tar.gz
   rm -f db-4.8.30.tar.gz
fi

cd db-4.8.30/build_unix
../dist/configure --prefix=/usr/local --enable-cxx # If this doesn't work, try removing or changing prefix
make
sudo make install
cd ~/Downloads
rm -fr db-4.8.30/

# Build bitcoin
cd ~/Downloads
if [ ! -e bitcoin ]
then
   git clone https://github.com/bitcoin/bitcoin ~/Downloads/bitcoin
fi

cd bitcoin

./autogen.sh
./configure # Non Ubuntu 13.xx versions
# ./configure --with-boost-libdir=/usr/lib/x86_64-linux-gnu # Ubuntu 13.xx version
make
sudo make install

cd ~/Downloads
rm -fr bitcoin

puk

Posted 2013-04-20T00:32:49.047

Reputation: 233

If any of your posts were deleted you can see them by checking your profile. At the bottom of answers/questions overview is a link "show recently deleted answers/questions". I think you might also get a "response flag" (not sure). If you wish to inquire what happened to your answer, please see How can I know why my post was deleted?, and if that doesn't resolve it for you, please post a question in [meta].

– Murch – 2013-12-10T14:07:00.917

0

In the Open Synaptic Package manager, search: bitcoin and click install. Bitcoin is already in the UBUNTU repositories.

bitcoinbk

Posted 2013-04-20T00:32:49.047

Reputation: 1

0

This is ubuntu we're talking about.

sudo apt-get install bitcoin


will work.

Yitzhak

Posted 2013-04-20T00:32:49.047

Reputation: 249

0

i am able to get them but i am getting the api of functionalities which are in the link https://en.bitcoin.it/wiki/Running_Bitcoin bit not related to client api list which are in https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

Coinex Market

Posted 2013-04-20T00:32:49.047

Reputation: 1

Welcome to BitcoinSE! Your answer can be improved if you state what "them" are and possibly explain how you use the api. – Willtech – 2018-02-03T08:56:02.580

-1

Oh, once you run it after install, It could take up to 7 hours to update your wallet. After it's updated. Remember to encrypt your bitcoin wallet with a hard password but one you can never forget. Because if you do forget your password, All your bitcoins will be lost.

bitcoinbk

Posted 2013-04-20T00:32:49.047

Reputation: 1

Please edit your answers to improve them or comment on them instead of adding additional answers. – Murch – 2013-12-05T14:58:28.640