This a step by step guide on how to setup your own crypto-currency mining pool. This guide is going overheen how to setup an MPOS (Mining Portal Open Source) Pool using NOMP spil stratum (Knot Open Mining Portal). This is meant to setup a mining pool for a SINGLE CRYPTO CURRENCY. This is not a guide for a Multipool.
If you want to see what it looks like before you set it all up, head to the SparkPool
For this guide purpose wij I will be using litecoin (scrypt) Crypto Currency .
- VPS with at least 1GB of Ram you can get it from any where like vultr , lenode , digitalocen
- Ubuntu 14.04 x64
- Putty (http://www.chiark.greenend.org.uk/
At this point you should have your VPS began, putty up and running and your logged ter spil root.
I am setting up a 4GB interchange, which may be overkill but it’s the most common exchange sized used te most guides so ill keep it at that.
dd if=/dev/zero of=/mnt/myswap.exchange bs=1M count=4000
Now let’s add it into fstab so it’ll activate at boot.
Add the following line at the end of the verkeersopstopping.
/mnt/myswap.exchange none interchange sw 0 0
Ctrl+O to save, and Ctrl+X to uitgang the nano editor.
Now your interchange is setup, you can modify the size te the future if you need more or less.
-Install Required Packages
apt-get install git
apt-get install build-essential libboost-all-dev libcurl4-openssl-dev libdb5.1-dev libdb5.1++-dev mysql-server
Set a MySQL Root Password (different from your Ubuntu root pass!)
Install Required Packages for Mining Portal Open Source (MPOS)
Let’s get Apache Web Server Going:
apache2ctl -k zekering, sleep Two, sudo apache2ctl -k embark
You will get a message stating it could not reliably determine your servers domain name, don’t worry about this right now. The web server is still running, just go to your server’s ip (http://youserverip) te chrome
Install Required Packages for NOMP Stratum
curl –sL https://deb.nodesource.com/setup | bash –
apt-get install -y nodejs
npm install –g npm
npm install forever -g
apt-get install redis-server
Webmin is a GUI interface for managing your server.
Press the Down Arrow on your keyboard to reach the end, and add thesis two lines below:
Press Ctrl+O to save, and uitgang the nano editor with CTRL+X
Let’s get Webmin’s GPG Key
apt-key add jcameron-key.asc
apt-get install webmin
Webmin should now be installed, now let’s see if it works. Open your browser and go to https://yourserverip:10000/
Go ahead and login.
Password: Your server’s root password
If any updates speelpop up te webmin, then go ahead and install those updates.
apt-get install phpmyadmin
You then will be asked to configure a database, succesnummer ok and then waterput te the password you setup with MySQL earlier.
Now wij need to add phpmyadmin to Apache.
ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
service apache2 reload
Head to http://yourserverip/phpmyadmin
Login to make sure everything is good.
Password: the one you setup earlier
Once you login you will see Trio or Four default databases on the left palm side. You are good to go.
If you get a crimson error message on the bottom of phpmyadmin stating mcrypt is missing then do this:
service apache2 restart
Loom back into phpmyadmin and the mcrypt error should be gone.
Mining Pool Setup
Very first let’s download some of the pool software on your PC. Yes, you’ll be using git and what not to download it on your server however there is a few files you will want to interact with on your PC.
Samenvatting that somewhere on your PC that you can lightly access.
You never run things like your coin daemon (wallet), mysql, or other things spil root!
Let’s create a user for your mining pool.
Login to ssh using putty spil root.
You’ll be prompted for a password, please use a password that is different from your root password.
The other informatie it asks for you can either pack out or just leave wit and kasstuk inject.
Now let’s give that fresh user sudo access.
adduser usernameyousetup sudo
MySQL User and Database Setup
Reminisce phpmyadmin? Head back to it: http://yourserverip/phpmyadmin
Using the password you setup earlier, login spil root.
Head to the “Users” button on the top of the pagina
Click on “Add user” te the middle of the pagina.
-Fill ter the “User name:” field with any username you’d choose. I like to name it after the coin I am setting up a pool for.
-Then click the button next to “Generate password:”
-You can use your own password, but I choose the generated password since it is very strong. Just reminisce to write it down somewhere.
-Now click the checkbox for “Create database with same name and grant all privileges”
If everything is good, then scroll down a bit and click “Go” ter the bottom right of the pagina.
-You should get a success message.
Now let’s invoer the MPOS database.
Click on your pool username/database you just created ter the left side of phpmyadmin.
Once you have clicked on the database, go ahead and click “Import” on the top of the
You will see a “Choose File” button, go ahead and click it and browse to the location you extracted that MPOS wij downloaded before to.
Once you navigate to the “php-mpos-master” folder on your pc go ahead and click on the “sql” folder inwards. Then click on “000_base_structure.sql” and click open.
That’s all you have to do for settings
Now click “Go” on the bottom of the pagina. You should get a success message stating your invoer wasgoed successful.
The MySQL user and Database has bot successfully setup for your mining pool.
Litecoin Daemon Setup (Wallet)
Now let’s setup the coin daemon, I will be using litecoin.
Now boot up putty and login to that fresh user wij setup earlier.
tar -xzf litecoin*
After issuing “ls” you will see that litecoind and litecoin-cli are te the bin directory.
You will get a message stating there is no configuration opstopping, and they suggest such and such rpc user/pass. Wij are getting to that.
Now wij need to setup the config verkeersopstopping for the litecoind.
I am going to commence using WinSCP to edit/add files, yes you can use nano, gedit, vim, or whatever shell based text editor you want instead. However, when a novice starts editing spil many files spil wij are about to edit it will be lighter for them if they use graphic interface for all of it. It will also help a novice understand the verkeersopstopping structure better.
I will walk you through WinSCP with this litecoind config opstopping, but after that you should be able to use it lightly if I just list out what directory you need to go to. You will see here shortly.
Once you install WinSCP, you should be prompted with a login screen.
- Select “New Site”
- “File Protocol” will be SFTP
- “Hostname:” is your VPS IP
- “Port number” is your ssh port that you have bot using with putty
- “User name:” will be root
- “Password:” is your root password
Click login, make sure to accept the host key.
Now that you have logged ter, you are ter the /root folder. Dual click the “..” to back out of it.
The opstopping path is /huis/username/.litecoin
- Click on the “home” folder.
- Click on the folder that is named after your username.
- Click on “.litecoin” it will be grayed out like
Right click on the white area te WinSCP and Go to “New” and “File”. Should look
Name the opstopping “litecoin.conf”
A white text editor window should speelgoedpop up, this is WinSCP’s internal editor and what wij will be using to edit files. Now we’ll want to waterput some basic stuff into the configuration opstopping. You should undoubtedly use a different username and password then that I use ter the guide. I am just using the ones that litecoind generated for mij already.
The default listen port for litecoin is 9333.
Now that you have updated the litecoin.conf opstopping, go ahead and click on the floppy disk icon ter the top left of the WinSCP Editor.
Now that wij have setup and saved the config verkeersopstopping, let’s get back into ssh (putty) on your user that you created earlier.
You should get a message that states “Litecoin server starting” if for some reason you can’t get out of that guideline simply press Ctrl+C te putty and it’ll fix it.
Now let’s make sure it’s updating.
The wallet should be fully updated by the time this guide is overheen, however if you are quick or unassured simply run the getinfo directive again and compare the block number to http://explorer.litecoin.televisiekanaal/ if the block number matches what’s on that webpagina then you are good to go.
Now let us set the crontab so that the litecoin daemon (litecoind) will always commence on boot.
- Select “2. /bin/nano <,—- easiest”
- Use your arrow keys to scroll down to the bottom of the crontab.
- Add this line below the # symbols.
- Press Ctrl + O to save and Ctrl + X to uitgang
The Litecoin daemon will now begin on boot.
Last thing wij need to do is get a fresh address for our litecoin wallet.
An address will vertoning up, please keep record of this address. Wij will be using it straks ter the guide.
NOMP Stratum Setup
Next we’ll be setting up NOMP (knot open mining portal) to be used spil a stratum server. NOMP has it’s own vooraanzicht end, but wij are using MPOS spil the gevelbreedte end instead. Keep following the guide, you will see.
Get on your user (not root) on ssh (putty).
The instruction wij just did, “cd” by default put’s your user ter it’s huis folder (/huis/username), where wij will be installing a lotsbestemming of stuff.
Let’s download NOMP and waterput it ter a directory called nomp.
git clone https://github.com/zone117x/node-open-mining-portal nomp
Let’s go into the nomp directory now.
Let’s update nomp, it may take awhile depending on your servers internet connection.
Now wij will create a real config verkeersopstopping for nomp.
cp config_example.json config.json
Alright, now you need to boot up WinSCP again and login. Navigate to the nomp directory, which is /huis/username/nomp
If you are still logged into WinSCP from before, you may need to right click and click on refresh ter order to see the nomp directory.
You’ll see the config.json, right click on it and edit.
Scroll down to where you see:
You need to switch the “true” to false. Should look like this when you are done:
Now you can save it and uitgang out of that config.json a, but wij are still using WinSCP so keep it open.
Alright, now NOMP needs even more configuration. Wij have not pointed it at the database yet, or set the ports, coin daemon details, etc… Let’s get into that.
Open up your ssh terminal again (putty) under your user.
cp /huis/username/nomp/pool_configs/litecoin_example.json /huis/username/nomp/pool_configs/litecoin.json
Open up WinSCP, navigate to /huis/username/nomp/pool_configs
You’ll see the fresh litecoin.json verkeersopstopping you just copied overheen with that previous directive.
Right click on it and edit it.
-Change “enabled” to true.
-“address” is that wallet address you saved earlier before, make sure you copy and paste that ter there.
-You’ll see “paymentProcessing” and “enabled” below that, switch that to false.
-Now you’ll see “ports” scroll down to where you see port “3032”, switch it to “3333”.
-Go down to where you see “daemons”.
-Port will be 2300 if you copied my litecoin.conf settints from before.
-“user” is your rpcuser from the litecoin.conf.
-“password” is your rpcpassword from the litecoin.conf.
-Scroll down to “p2p” and find the “enabled” below it and switch it to false.
-Scroll down to “mposMode”.
-Change “enabled” to true.
-Change “user” to the username you setup on the phpmyadmin step from before
-Change “password” to the password you setup on the phpmyadmin step
-Change “database” to the database you setup on the phpmyadmin step (wij made it the same spil username)
If any of the settings are wrong, your stratum will not work. Please dual or triple check!
Make sure everything saved correctly, wij will come back to NOMP straks on.
MPOS Initial Setup
Let’s setup MPOS (Mining Portal Open Source), which will be the frontend of your pool webstek.
Alright, let’s go this going. Login to ssh on your user if you are not already.
git clone https://github.com/MPOS/php-mpos.git mpos
sudo chown –R www-data templates/compile templates/cache logs
Let’s copy overheen the configuration.
sudo cp include/config/global.inc.dist.php include/config/global.inc.php
Alright, now let’s setup the MPOS global configuration verkeersopstopping. Open up WinSCP and navigate to /huis/username/mpos/include/config/ and right click on global.inc.php and edit it.
Alright, same spil what I did with NOMP before. I will go through the steps of what to edit, and then ill postbode some screenshots of what I did afterwards.
-Scroll down to “SALT” and “SALTY”, see how it says make it something random? Literally mash on your keyboard and just get at least 20+ characters. This is what they use to scramble passwords.
-Scroll down to “algorithm”, if you are using litecoin it should remain “scrypt” and you don’t have to switch it.
-Scroll down to “Database Configuration”
-‘user’ will be the user you setup ter phpmyadmin from before
-‘pass’ is the password you generated on phpmyadmin
-‘name’ is the name of the database you created with phpmyadmin before, wij named it the same spil the user if you followed the guide exactly.
-Move down to “Local wallet RPC”
-On ‘host’ switch 19334 to 2300
-‘username’ to your rpcuser from the litecoin.conf
-‘password’ to your rpcpassword from the litecoin.conf
Now, for Litecoin the global config is all setup now. You can switch the ondergrens and maximum auto-withdrawals, and everything else after you make sure the pool is operational.
Now wij need to point the Apache Virtual Server towards the MPOS public directory.
Login to Webmin, https://yourserverip:10000/
-Go to Servers >, Apache Webserver.
-You should see the Virtual Server that says “Handles the name-based server on address *.”, click on that virtual server.
-Go to “Virtual Server Details” on the bottom
-Find “Document Root” and switch “/var/www/html” to “/huis/username/mpos/public”,
Now wij need to update the Apache configuration a bit.
-Click on “Global Configuration” on the top center left,
-Click on “Edit Config Files”
-Scroll all the way to the bottom of the config verkeersopstopping
-Add this to the bottom, and update it according to your username obviously.
Options Indexes FollowSymLinks
Require all granted
-Click on “Apply Changes” te the type right of Webmin.
Now let’s see if the MPOS frontend is working, go to http://yourserverip
If you see the MPOS frontpage, then go ahead and skip to the “MPOS Frontend Initial” step.
If you get a wit pagina, don’t worry it may be a permissions kwestie.
Login to root on ssh.
chown -R www-data templates/compile templates/cache logs
Now head back to http://yourserverip and see if MPOS shows up.
Before wij get into the cronjobs, let’s go ahead and get familiar with MPOS.
Click on “Other” and then click “Sign up”
The very first account on MPOS is the admin account and does not require email activation. Pack te the informatie and then click “Register” on the bottom.
he coin address is just your wallet, that you want your mined coins to go to. By default MPOS won’t let you register without one.
Also, if you are getting “token expired” messages don’t worry, it’s just MPOS being finicky. Attempt again.
You should get a “Please check your mailbox to activate” message, don’t worry you do not need to activate anything spil the very first account is the admin account.
Go ahead and login.
-Go to Admin Panel >, System >, Settings
-Click on “System” on that settings pagina:
-Find “Disable e-mail confirmations” and select yes.
-Scroll to the bottom and click save.
Now you just set it so users can register without email confirmations, which is significant if you don’t have a mail server setup. The other settings you can fucktoy with zometeen on after this guide is overheen, such spil your pool name.
Last thing, go to Admin Panel >, System >, Monitoring
This pagina is not significant now, but it will be when wij setup the cronjobs. Please keep it open ter a tabulator on your browser for zometeen. I will refer to it spil the “Monitoring Page” ter the cronjob section of this guide.
Do not worry if there is issues like “we can’t poke your Stratum server”, because the Stratum is not commenced yet. Wij will get into that here shortly.
MPOS Cronjob Setup
MPOS work’s off of Three different main cronjobs. Payout, statistics, and maintenance. There are others, but this is what wij will be setting up. Wij will run them every minute, it is very significant that you run thesis crons every minute otherwise MPOS likes to pauze.
Login to Webmin, http://yourserverip:10000/
Go to System >, Scheduled Cronjobs
-Select “Create a fresh scheduled cronjob” on the bottom.
-“Execute cron job as”, select your user.
-“Active” will be yes.
-Command will be “/huis/username/mpos/cronjobs/run-statistics.sh”
-Go down to “Minutes” and click on the “selected” and then highlight all the numbers.
Now you will create Two more cronjobs using the precies process wij just did above, for “/huis/username/mpos/cronjobs/run-maintenance.sh” and “/huis/username/mpos/cronjobs/run-payout.sh”
I won’t repeat the process, it’s truly straight forward and I am sure you can do it if you have gotten this far te the guide.
Alright, reminisce that “Monitoring Page” I had you leave open? Go back to it, and kasstuk refresh.
Your monitoring pagina should get fresh results shoved to it every minute, if not it’ll turn yellow and eventually crimson.
Congraulations, your cronjobs are setup.
Recall NOMP? Wij are going to turn it on now.
Loom back onto ssh (putty) spil your user.
Before wij set NOMP to stay on “forever” wij are going to make sure it works very first while wij can still interact with it.
Let’s embark the stratum server ter shell.
If you have no errors, then you are good your stratum is running. If you have issues, please go back to the NOMP setup part of the guide.
Now fire up your miner, I am not going to go into specifics about setting up cgminer or what have you. If you don’t know how to setup a miner, you most likely should of researched that long before you attempted to setup your own pool.
Details for your miner:
Now type this to keep init.js running indefinitely (until you restart your server or nomp crashes).
forever commence init.js
Your Stratum is now running, and will stay running even if you close your ssh terminal.
Congratulations You have now your own Mining Pool Ready to Begin
If you liked this guide, please donate to mij spil well!