<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Saad Ali on Medium]]></title>
        <description><![CDATA[Stories by Saad Ali on Medium]]></description>
        <link>https://medium.com/@wordpressdelta?source=rss-d812297e62bc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6BbOv37oCp6hJpyC</url>
            <title>Stories by Saad Ali on Medium</title>
            <link>https://medium.com/@wordpressdelta?source=rss-d812297e62bc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 00:42:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wordpressdelta/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[My First Experience with BTCPay Server Installation on Ubuntu 18.04]]></title>
            <link>https://medium.com/@wordpressdelta/my-first-experience-with-btcpay-server-installation-on-ubuntu-18-04-ab9a58797430?source=rss-d812297e62bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab9a58797430</guid>
            <category><![CDATA[freedom]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[payment-gateway]]></category>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[Saad Ali]]></dc:creator>
            <pubDate>Fri, 30 Nov 2018 02:48:36 GMT</pubDate>
            <atom:updated>2018-11-30T02:48:36.944Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kbXCVf4Q6aUvYtWvZlzlxA.jpeg" /></figure><p>This post talks about how to setup your own cryptocurrency payment gateway to accept payment on your website without going through any second,third or fourth-party to receive payments.</p><p>When the developers says not recommended, what they are trying to tell you that “Don’t try this at home”.</p><p>It took me close to 4 days for the complete setup and there were at least three times where I was going to completely give up. These were the times I usually stop working and decide later day If I want to continue or not.</p><p>I with my limited knowledge of the stack, some downtime and troubleshooting skills, I decided to go with the Manual deployment and the hopa-holas I had to go through to get it working in the manual mode are in the section below and an easier way around it at the end.</p><p>In the end was able to make a payment on my store, so as far as Operational aspect it’s up and running, although I will need some guidance on clean up and security aspect of it.</p><h3>Install the Ubuntu from this location.</h3><p>The first decision was do I install the server or the deskop image, upon reading further the server image doesn’t have GUI so I went ahead and select the Ubuntu Desktop Image from this location [<a href="http://releases.ubuntu.com/18.04.1/ubuntu-18.04.1-desktop-amd64.iso">Ubuntu Image</a>]</p><h3>Manual Installation — Installation Successful, Failed at Configuration</h3><p>I was not able to find information on how to change the IP Address for the BTCPayServer online, although I tried to use externalurl command but didn’t succeed, Regardless if someone attempt to go this route then this seciton may provide a guide on things to avoid.</p><p>In the manual installation, It should be indicated that if they use BTCPay-Docker they will not have to individually install the components such as Bitcoin Core, NBExplorer and BTCPayServer, since BTCPay-Docker takes care of all of them.</p><p>Please note that my concern arise from my limited understanding of the technology.</p><p>For Manual Deployment, I used <a href="https://github.com/btcpayserver/btcpayserver-doc/blob/master/ManualDeployment.md">this</a> as a guideline</p><p>1. Download and sync <a href="https://bitcoincore.org/">Bitcoin Core</a><br>2. Clone and run <a href="https://github.com/dgarage/NBxplorer">NBXplorer</a><br>3. Clone and run <a href="https://github.com/btcpayserver/btcpayserver">BTCPay Server</a></p><h3>Pre-requisites</h3><p>I used the information available on this page <a href="https://nbitstack.com/t/how-to-manually-install-btcpay-on-ubuntu-18-04/76">.Net Core Install for BTCPay on Ubuntu 18.04</a></p><pre><em>sudo apt-get update<br>sudo apt-get upgrade<br>sudo add-apt-repository universe<br>sudo apt-get update</em></pre><pre><em>wget -q </em><a href="https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb"><em>https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb</em></a></pre><pre><em>sudo dpkg -i packages-microsoft-prod.deb<br>sudo apt-get install apt-transport-https<br>sudo apt-get install dotnet-sdk-2.1</em></pre><h3>DNS and SPF</h3><ol><li>Created an A Record and Pointed it to the host for e.g.<br>pay.wpdelta.com 123.456.789.012</li><li>Created an SPF record to send an email from the server and without being marked at spam.</li></ol><p><strong>Statement:<br> </strong>First install .NET Core SDK v2.1.4 (with patch version &gt;= 403) as specified by <a href="https://www.microsoft.com/net/download/dotnet-core/2.1">Microsoft website</a>.<br> <strong>Concern:<br> </strong>My installation had the .net core version was v2.1.5, Do I need to install the v2.1.4 as well?<br> <strong>Action:<br> </strong>I thought to myself that v.2.1.5 should work as well, and if in the next steps something failed that I go back, uninstall v2.1.5 and reinstall v2.1.4 but I didn’t had to do it.</p><h3>For BitCoin Core</h3><p>I followed these steps, [<a href="https://bitcoin.org/en/full-node#ubuntu-1604">Ubuntu Install — Bitcoin Core</a>]</p><pre><em>sudo apt-add-repository ppa:bitcoin/bitcoin<br>sudo apt-get update<br>sudo apt-get install bitcoin-qt bitcoind</em></pre><p><strong><em>Statement<br></em></strong>Stable Channel of bitcoin-qt and bitcoind for Ubuntu, and their dependencies</p><p>Note that you should prefer to use the official binaries, where possible, to limit trust in Launchpad/the PPA owner. No longer supports precise, due to its ancient gcc and Boost versions.<br>More info: <a href="https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin">https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin</a><br> <strong><em><br> Concern:<br> </em></strong>Do I have to retake english classes ? Do I download it from ppa:bitcoin/bitcoin or should I follow other linux instructions, as it’s mentioned that it’s for Ubuntu 16.04</p><p><strong><em>Action:</em></strong><em><br> </em>Since ppa:bitcoin/bitcoin is mentioned in the bitcoin.org page, this is reliable link and I should use it, if it works for 16.04, it should work for 18.04 as well, if it fails I will try the alternatives.</p><h3>For NBXplorer</h3><p>I used the information from this <a href="https://freedomnode.com/blog/114/how-to-setup-btc-and-lightning-payment-gateway-with-btcpayserver-on-linux-manual-install">link</a></p><pre>git clone <a href="https://github.com/dgarage/NBXplorer">https://github.com/dgarage/NBXplorer</a><br>cd NBXplorer<br>./build.sh</pre><h3>For BTCPayServer</h3><p>Source: <a href="http://blog.sipsorcery.com/?p=1052">sipsorcery</a></p><pre><em>git clone </em><a href="https://github.com/btcpayserver/btcpayserver.git">https://github.com/btcpayserver/btcpayserver.git</a><em><br>./build.sh</em></pre><h3>Running for the First Time</h3><p>Launch bitcoin core gui, <br> Goto the .btcpayserver and issue the command ./run.sh<br> Goto the .nbxplorer and issue the command ./run.sh<br> <br> <strong>Issues</strong></p><p>1. Info: Configuration: BTC: Testing RPC connection to <a href="http://127.0.0.1:8332/">http://127.0.0.1:8332/</a><br> Fail: Configuration: BTC: Error connecting to RPC: Connection refused</p><p>2. Fail: Configuration: BTC: Unhandled in Waiter loop</p><p><strong>Action:</strong><br> Lets check configuration, <br> For nbexplorer in .nbxplorer/main/settings.config and for bitcoin in .bitcoin/bitcoin.conf<br>Turns out there is no settings in bitcoin.conf file, me go fetch sample config file for bitcoin.conf</p><p>Try uncommenting or modifying the following lines to check</p><p>.bitcoin/bitcoin.conf</p><pre>connect=127.0.0.1:8333<br>rpcport=8332</pre><p>./nbxplorer/Main/settings.config</p><pre>btc.rpc.url=http://127.0.0.1:8332<br>btc.node.endpoint=http://127.0.0.1:8333</pre><p>The Issue was resolved and the server was now successfully running on 127.0.0.1:23000, I tried to find information on how to change that to valid domain name, but couldn’t. I could have spent more time but then I realize I would also need to manually configure letsencrypt after that as well. At this point I was under the impression that BTCPAYServer-Docker only install BTCPAYServer without NBXplorer and Bitcoin Core.</p><h3>BTCPAYServer-Docker</h3><p>Next day I decided that I am going to try BTCPAYServer-Docker to see if gives me options to configure the domain name and other settings.</p><p>I followed the guide at this <a href="https://medium.com/@BtcpayServer/hosting-btcpay-server-for-cheap-2b27761fdb9d">page</a></p><pre>sudo su<br>apt-get update &amp;&amp; apt-get install -y git<br>git clone <a href="https://github.com/btcpayserver/btcpayserver-docker">https://github.com/btcpayserver/btcpayserver-docker</a><br>cd btcpayserver-docker<br>export NBITCOIN_NETWORK=”mainnet”<br>export BTCPAYGEN_CRYPTO1=”btc”<br>export BTCPAYGEN_CRYPTO2=&quot;ltc&quot;<br>export BTCPAYGEN_LIGHTNING=&quot;clightning&quot;</pre><pre>export ACME_CA_URI=”<a href="https://acme-staging.api.letsencrypt.org/directory">https://acme-staging.api.letsencrypt.org/directory</a>&quot;<br> ssh-keygen -t rsa -f /root/.ssh/id_rsa_btcpay -q -P “”<br> echo “# Key used by BTCPay Server” &gt;&gt; /root/.ssh/authorized_keys<br> cat /root/.ssh/id_rsa_btcpay.pub &gt;&gt; /root/.ssh/authorized_keys<br> export BTCPAY_HOST_SSHKEYFILE=/root/.ssh/id_rsa_btcpay<br> export BTCPAY_HOST=”pay.wpdelta.com”<br> export LETSENCRYPT_EMAIL=”<a href="/service/mailto:email@example.com">w</a>ordpressdelta@gmail.com”</pre><pre>. ./btcpay-setup.sh -i</pre><p>I checked the configuration from the configuration file location at/etc/profile.d/btcpay-env.sh<br>And discovered that following settings were not applied</p><pre>export BTCPAYGEN_ADDITIONAL_FRAGMENTS=&quot;&quot;<br>export BTCPAYGEN_LIGHTNING=&quot;clightning&quot;<br>export BTCPAYGEN_CRYPTO2=&quot;ltc&quot;</pre><p>for the fragment it’s was a simple misspell, but for the others, I am not sure why there weren’t added initially, ran the following commands</p><pre>export BTCPAYGEN_CRYPTO2=&quot;ltc&quot;<br>. ./btcpay-setup.sh -i</pre><pre>export BTCPAYGEN_LIGHTNING <br>. ./btcpay-setup.sh -i</pre><p><strong>Issue<br> </strong>Limited diskspace, at this point I didn’t realize that BTCPAYServer-Docker was going to use it’s own bitcoin node and not the one I initially installed using manual deployment, although there may be a way out-there to make the docker use the bitcoin node that I had configured,</p><p><strong>Action:<br></strong> Shutdown the Ubuntu, Extend the disk space on the Virtual drive,<br> Insert Gparted ISO, Increase the /dev/sda2,</p><p><strong>Launch Ubuntu, run</strong></p><pre>lsblk</pre><pre>Assign the Additonal Disk space to Partition.</pre><pre>sudo pvresize /dev/sda2<br>sudo lvresize -l +100%FREE /dev/mapper/ubuntu–vg-root<br>sudo resize2fs /dev/mapper/ubuntu–vg-root</pre><p>Didn’t learn from mistake first time, I reran into space issue again, this time I expand the disk, using Gparted extend the parition but Ubuntu was not rebooting at all, it was stuck.</p><p><strong>Errors Displayed:<br>Gave up waiting for suspend/resume device and stuck at start. User Id Manager..</strong></p><p><strong>Action:<br> </strong>Press ESC to goto Advanced Options, Select Recovery and Command Prompt Shell and modified the following.</p><p>Ran following commands and compared the UUID</p><pre>lsblk -f<br>blkid</pre><p>There were a match, issue somewhere else.</p><p>Found similar issue at this <a href="https://ubuntuforums.org/showthread.php?t=2398627">page</a></p><pre>/etc/initramfs-tools/conf.d/resume<br>RESUME=none<br>sudo update-initramfs -u<br>The error was gone at next boot up, but it still didn’t boot.</pre><p>The error was going but it still didn’t boot, so I Boot again in the recover mode and checkd system information, the physical volume was listed as bad not ok, instead of fixing this, I went ahead and ran the following commands again to add space to the mount.</p><pre>sudo pvresize /dev/sda2<br>sudo lvresize -l +100%FREE /dev/mapper/ubuntu–vg-root<br>sudo resize2fs /dev/mapper/ubuntu–vg-root</pre><p>and the Ubuntu Booted.</p><p>To confirm that BTCPayServer-Docker was not using any of the manual installation directories, I renamed them to following.</p><p>.nbxplorer.bak<br> .bitcoin.bak<br> .btcpayserver.bak</p><h3>Email Server Settings</h3><p>At 3:12am, My mind decided that I needed to install a Mail Server on the BTCPayServer to send emails. <br> Followed the guide at this page and successfully installed the Mail Server, although at the same time as I didn’t hear this being mentioned anywhere I knew I was going on wrong direction but then, why do I do anything I do?</p><p><a href="https://hostadvice.com/how-to/how-to-setup-postfix-as-send-only-mail-server-on-an-ubuntu-18-04-dedicated-server-or-vps/">Install Postfix</a></p><p>One thing I did get out of this, that if you got a Mail Server and you only want to send out-going emails originating from that email, you would modify the following line</p><p>File: /etc/postfix/main.cf</p><pre>inet_interfaces = loopback-only</pre><p>I am using Zoho, because five users are free, you could use your own domain to receive the emails, for e.g. <a href="/service/mailto:info@yourdomain.com">sales@wpdelta.com</a> I used the following settings.</p><p>Server: smtp.zoho.com<br>Port: 587<br>From: <a href="/service/mailto:email@domain.com">sales@wpdelta.com</a><br>Login: sales@wpdelta.com<br>Password: Th@nkYo0S@tosHi:)</p><p>I added the IP to the SPF record so that emails are not marked as spam</p><p><strong>Issue<br></strong>Created a Product in WooCommerce, and went to Check-Out, But the error was thrown out, went to check and redid the derviation Scheme, and this time a wallet link appeared. Did a test payment and it succeeded.</p><p><strong>Confirmation from Experts<br></strong>Although I am pretty sure, but nevertheless require confirmation from experts regarding following things</p><ol><li>Does BTCPayServer-Docker, installs all components required for e.g. NBXplorer, Bitcoin Node, letsencrypt</li><li>If the BTCPAYGEN_ADDITIONAL_FRAGMENTS is used, is the node still a full node</li><li>Segwit wallet if possible should be used instead of Standard wallet</li><li>SMTP is being used to authenticate user account so SPF may not be required.</li></ol><p><strong>Lessons Learned</strong></p><p>1. BTCPayServer-Docker does not require manual installation of Bitcoin core, NBExplorer and LetsEncrypt<br>2. Ubuntu Partition could be resized without losing any data<br>3. Email Server settings requires SMTP connection information<br>4. Both Domain and SPF records needs to be configured to load the page and accept email.<br>5. Pay Button do not require BTCPay WooCommerce Plugin.<br>6. Segwit and Standard address only differs in the address format but are on same blockchain<br>7. Private Keys are not stored on the server, so you can use VPS hosting</p><p>TL;DR:</p><ol><li>Install Ubuntu 18.04</li><li>Install .NET Core</li><li>Configure DNS, Create A or CNAME Record and Add IP to SPF</li><li>Install using <a href="https://github.com/btcpayserver/btcpayserver-docker">BTCPay Server-Docker</a>.</li><li>Create Store, Download Walle and Add Derivation Scheme,</li><li>Thanks and Donate to <a href="https://mainnet.demo.btcpayserver.org/apps/87kj5yKay8mB4UUZcJhZH5TqDKMD3CznjwLjiu1oYZXe/pos">Nicolas Dorier</a>.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab9a58797430" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>