Want live help from a dedicated Tech Agent?

How to install Zcash in your server

Amal 2 years ago - Created

If you are using AWS you have to enable following port.
Port: 18232

1. Login to the Droplet

We will connect to the server with the SSH key we added to the server in Step 1.

Copy your IP address we created in Step 1. We will use the same bitcoin-cash server we created for Bitcoin Cash. You’ll find your IP address here:

Enter the command below in your Terminal, substituting the your_server_ip with the IP address of your Droplet for and {path_to_serverkey} with the file path of the private SSH key we created earlier:

ssh root@your_server_ip -i {path_to_serverkey}

Hit Enter. You will be prompted to enter the passphrase we created while creating this private key. Enter the password and press Enter again.

If you are on a Mac, you might be prompted to type your keychain password.

Do not follow step 2 - 5 if you have installed Bitcoin cash. Because we are putting both coins in the same instance.

2. Install Apache

Our next step is to install Apache. Type the following commands in the terminal:

sudo apt-get update
sudo apt-get install apache2
You will be prompted with a (Y/n). Type y and press Enter.

You have now installed Apache web server successfully.

3. Install PHP

PHP is the component of our setup that will process code to display dynamic content. It can run scripts, connect to our MySQL databases to get information and hand the processed content over to our web server to display.

Step 1: Install PHP to server Type the following commands into the terminal:

sudo apt-get install php7.0 libapache2-mod-php php-mcrypt php-mysql php-gd php-bcmath
You will be prompted with a (Y/n). Type y and press Enter.

This should install PHP without any problems.

Change the location of index.php

To do this, type this command to open the dir.conf file in a text editor with root privileges:

sudo nano /etc/apache2/mods-enabled/dir.conf

Inside of the file will look like this:

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm

We want to move the index.php file above to the first position after the DirectoryIndex, like this:

DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

When you are finished, Press Control + O to save.

And press Enter.

Then press Control + X to exit.

You have now installed PHP successfully.

4. Install CLI and CURL

To do this, type the following command into your Terminal:

sudo apt-get install php-cli php-curl curl
You will be prompted with a (Y/n). Type y and press Enter.

You have now installed CLI and CURL successfully.

5. Install Zcash Blockchain

Run the following commands one by one to install Zcash Daemon.

sudo apt-get install apt-transport-https 
wget -qO - https://apt.z.cash/zcash.asc | sudo apt-key add - 
echo "deb [arch=amd64] https://apt.z.cash/ jessie main" | sudo tee /etc/apt/sources.list.d/zcash.list
sudo apt-get update
sudo apt-get install zcash
You will be prompted with a (y/n). Enter 'y' to continue.

6. Configure the Zcash installation

1. Create a directory name .zcash in the root directory with the following command:

mkdir .zcash

2. Create a conf file named zcash inside the above directory with the below command:

sudo nano /root/.zcash/zcash.conf

3. Enter the following lines into the new files to configure this blockchain to work with our exchange script, substituting ip_address_of_bitexchange with the IP address of the server we have hosted the crypto exchange script and 32_character_alphanumeric_string with a 32 character alphanumeric password. You can use a random password generator site to generate a password if you like.

rpcport=18232 addnode=testnet.z.cash
walletnotify=/var/www/html/cron/receive.sh %s

Now, save the file by pressing Control + O.

Then press Enter.

Finally, press Control + O to exit.

4. Open the rpc port we have given above:

ufw allow 22
ufw allow 80
ufw allow 18523
ufw enable
You can skip 5 - 10 if you have already installed Bitcoin Cash.

5. Now, connect to your server using Filezilla using the IP address of the Zcash droplet. Drag and drop the cron.zip you have downloaded to the /var/www/html/ folder in your Zcash droplet using Filezilla:

6. Now go to your Terminal and install Unzip by running the following command:

sudo apt-get install unzip

7. Navigate to the html folder:

cd /var/www/html

8. And type the unzip command in your Terminal and press Enter.

unzip cron.zip

9. Navigate to the cfg file inside cron folder.

cd /var/www/html/cron/

10. Open the cfg.php file inside this location with the following command:

sudo nano cfg.php

Update the dbname and dbpass values like we did in Step 6. Save and close the file.

11. Get Zcash network parameters using this command:


12. Next, run the Zcash daemon using the command:

zcashd -daemon

7. Configure admin panel to receive updates

1. Login to your admin panel by visiting admin.yourexchangedomain.com. If you haven't changed the password, the default credential is 

Username: admin

Password: DminaDminaDmina

2. Go to Currencies>Cryptocurrency Wallets.

3. We are configuring Zcash, hence go ZEC column and press Edit icon.

4. Update the connection to Daemon fields with the values you have given in your zcash.conf file and press Save.

8. Configure Cron

Configure Cron to start the Zcash daemon when the server restarts using the following commands:

sudo crontab -e

Go to the end of the file and add the following line:

@reboot zcash -daemon

Save by pressing Control + O.

Press Enter.

Press Control + X to exit.

You have now installed Zcash blockchain on your server.

Was this article helpful?

3 out of 3 found this helpful

Articles in this section