How to install Beanstalkd and Pheanstalk on Ubuntu


1). Install Ubuntu Desktop or Server using a Virtual Machine.

I used Oracle VM VirtualBox for this example.

Make sure that a Bridged Network Connection has been set.

Set a username and a password when asked to.

I used:

username: william
password: 123456

2). Start Ubuntu and Login

3). Login as Super User

use: sudo su
and enter the super user password when requested ( mine is: 123456 );

4). Install Open SSH and access the Ubuntu virtual machine via Putty.


use: apt-get install openssh-client

to install the client and then

use: apt-get install openssh-server

to install the server;

5). Install Apache2 web server

use: apt-get install apache2

now type the following in a browser:

your virtual machine ip ( mine was )

6). Install MySQL

use: apt-get install mysql-server php5-mysql

set password for MySQL root user: 123456
repeat password: 123456

7). Install PHP5

use: apt-get install php5 libapache2-mod-php5 php5-mcrypt

8). Install cURL

use: apt-get install curl

9). Install Composer

official website:
docs: ( Getting Started )

use: curl -s | php
use: curl -sS | php
now, composer.phar must be moved and converted

use: mv composer.phar /usr/bin/composer

Why to use Composer?

Just imagine this:

A team is developing a project.
The project uses third party software and/or scripts;
These third party requirements can reach 1GB, 10GB, …

You don’t want to commit in GIT the vendor files.

So, each project will use a composer.json file that stores all the vendor apps information and settings. ( apps, modules, scripts, etc … )

When a new member/developer joins the team, he will clone the project, he will download only the project files and then run: composer update

After the download/update is finished, all the vendor files will be available and the new team member can use the project;

10). Install Beanstalkd

use: apt-get install beanstalkd

now, let’s make sure that beanstalkd persistent mode is active
ps ax

ps ax | grep beans

locate beanstalkd.conf


locate beanstalkd.conf

nano /etc/default/beanstalkd

uncomment last line in order to save persistent mode to active

11). Install Pheanstalk


change directory
use: cd /var/www/html

create a new directory: /var/www/html/pheanstalk_test
use: mkdir pheanstalk_test

change directory to the new created directory
use: cd pheanstalk_test

create a composer.json file under this new directory
use: nano composer.json

write the following data in the file:

and save the file ( push Ctrl+X keys, push Y key, push ENTER key )

use: composer update

now, the vendor folder data should begin to download

or use: git clone

how to put data on tube/s

include ‘vendor/autoload.php’;
use Pheanstalk\Pheanstalk;
$pheanstalk = new Pheanstalk(‘’);

use: php put.php
and a put process will start
info! the more instances open, the more data gets put on the tube/s

how to get data from tube/s

include ‘vendor/autoload.php’;
use Pheanstalk\Pheanstalk;
$pheanstalk = new Pheanstalk(‘’);
echo $job->getdata();

use: php get.php
and a get process will start
info! the more instances open, the more data gets processed;
12). Install Beanstalk Console


change directory

use: cd /var/www/html

create a new folder

use: mkdir beanstalk_console

use: git clone

change the rights for the file: storage.json
chmod 777 storage.json

13). This is it!