# Introduction

## Introduction

Bitcart is an open-source, self-hosted all-in-one solution for Bitcoin and other cryptocurrencies.

You can use it in a variety of ways: from payment processing via our ready tools to custom applications via our SDK.

If you have trouble using Bitcart, consider joining the [communities listed on the official website](https://bitcart.ai/#community) to get help from Bitcart community members. Only file [Github issue](https://github.com/bitcart/bitcart/issues) for technical issues you can't resolve through other channels or feature requests you've validated with other members of community.

Please check out our [official website](https://bitcart.ai), our [complete documentation](https://github.com/bitcart/bitcart-docs) and FAQ for more details.

![](/files/-LzNV4QzRDKPyUMgbXoR)

## Features <a href="#features" id="features"></a>

* Direct, peer-to-peer cryptocurrency payments
* No transaction fees (other than those for the crypto networks)
* No processing fees
* No middleman
* No KYC
* User has complete control over private keys (in fact, private keys aren't required at all)
* Enhanced privacy
* Enhanced security
* Self-hosted
* SegWit support
* Lightning Network support
* Opt-in Altcoin integrations
* Easy to use API and SDK
* Process payments for others
* Powerful ready to use admin panel
* Ready store to get your first customers
* Many integrations available
* Extendable the right way

## How it works

### In a nutshell <a href="#in-a-nutshell" id="in-a-nutshell"></a>

In layman's terms, Bitcart is a solution for anything you might need to do in cryptocurrencies ecosystem.

If you need to process payments as a merchant, Bitcart can serve either as a full invoicing system, or just as a payment processor for cryptocurrencies' payment methods. When checking out, the customer will be presented with an invoice. The invoice is a fresh address from your wallet that wasn't used before. This way, by avoiding address re-use, your privacy is enhanced. Bitcart is using Electrum wallet protocol and it's SPV (Simple Payment Verification) feature to verify sent payments. After successful payment, your Bitcart instance can automate most of the work needed to fulfill the order safely. You are provided with ready solutions for your store, your company or application. Anything is possible with Bitcart.

But if you just need a way to check the blockchain, or a way to create transactions (for [tipping bot](/examples/atomic-tip-bot), for example), Bitcart provides ready developer tools for the most comfortable experience: ready and well-documented [SDK](https://sdk.bitcart.ai), Merchants API (see it's swagger documentation [here](https://api.bitcart.ai)) and various plugins.

### How is it different

Bitcart is a completely open source project. Every feature added, every change is documented and is publicly visible. There is no third-party between a merchant and a customer. Each merchant can set up their own individual instance, not dependent on other instances, or any third-party. Every action is under control of the merchant. As Bitcart is self-hosted, of course there are no processing or subscription fees.

As Bitcart is open source, everyone is welcome to read it's code, help in finding bugs and suggest new features! Security auditors can always inspect the quality of our code, and they have [a secure way](/development/security-disclosures) to report vulnerabilities to make them fixed before they were used for bad

There are a few projects existing in the cryptocurrencies sphere targeting payment processing, but Bitcart is way more than just that. Payment processing is just one of the possible use-cases, but the user can always choose which parts of Bitcart to use.

As Bitcart contains many features, it is modular (while most other projects aren't). That means, for example, that if you only need to use the SDK for custom apps-just enable our daemons only. If you also need to have a ready Merchants API to use in a store-like application, enable it too. If you need a powerful admin panel, you can enable it. And so on, Bitcart consists of individual independent parts, which are easy to customize and use.

Another key difference is that, we are open to community ideas, and the project is built by the community and is influenced by the community. Every important decision taken is decided via a public poll. We are building a positive community having fun and making use of Bitcart, with the same goal: to make it even better.

### How it keeps funds secure <a href="#how-it-keeps-funds-secure" id="how-it-keeps-funds-secure"></a>

Payments via Bitcart are direct, peer to peer. The merchant receives the coins directly to their wallet, with no intermediary.

How it works? For each invoice, Bitcart generates a new address, belonging to the xpub entered, and this address is presented to the user. As this address is your wallet's address, you receive the funds directly. Bitcart just watches the payments, it can't modify anything along the way, as when configuring the [wallet](/bitcart-basics/walkthrough#wallets), you only need to enter a watch-only [master public key](/support-and-community/faq/terminology-faq#what-is-an-xpub).

That way, you have complete control of the funds received.

### How it keeps data private <a href="#how-it-keeps-data-private" id="how-it-keeps-data-private"></a>

The data is shared only between two parties - the buyer and a seller. Only the data required for the app operation is saved, nothing else. The concept of decentralization is followed-if there are lots of indendent instances, there can't be a central server for anything. There are no data leaks in any operations, and all the information stored can only be viewed by the server owner (usually, the merchant)

### How it resists censorship <a href="#how-it-resists-censorship" id="how-it-resists-censorship"></a>

* Self-hosted
* Can be run everywhere, from low-powered device like Raspberry Pi at home to enterprise-grade servers
* No third-party
* Can easily be re-deployed

Bitcart does not have a central point of failure since nobody is controlling it except for the user running it. If run on the cloud server, the hosting providers can potentially censor users by suspending hosting accounts or disabling access to virtual machines. This is always a risk for anyone using a hosting provider. Since no private keys are stored on the server, a censored individual can easily re-deploy the Bitcart with another host. Your coins are always inside your wallet. If an invoice is paid while your Bitcart instance on the server is down, the software will automatically determine and notify the merchant of offline invoice payments when your server is back up. If a hosting provider suspends the server, and there was no proper backup, server settings and invoice data may be lost, but on-chain payments are always in your wallet. For ultimate censorship-resistance, users should run Bitcart on their own hardware.

### Beyond payment processing <a href="#beyond-payment-processing" id="beyond-payment-processing"></a>

Bitcart is not only a payment processor for merchants. It is called all-in-one crypto solution because it can be used for anything you want. It abstracts a lot of complex components into simple and easy to use interfaces, APIs and SDKs. Developers can build entire businesses and projects on top of the stack. Enterprises can use it as scalable and secure back-end of their infrastructure without ever having to put a trust in a third-party. Bitcart is a toolbox with lots of tools you can use, it's up to you how you want to use it.


# Use Case

Built with extensibility in mind, Bitcart is a feature-rich software with plenty of use-cases that can solve problems for different types of users.

In this guide, we will show you some of the use-cases of Bitcart, but it is by no means limited to the groups of users we mentioned.

So let's have a look at what you can do with Bitcart and what the benefits are of using it.

## Merchants

By choosing Bitcart to process payments, you are:

* Saving money (no fees, no subscriptions)
* Cutting out the middle-man (Payments go directly to your wallet)
* Enhancing privacy for you and your customers (no address re-use, no IP leaks to third parties)
* Saving time (easy integration and installation)
* Protecting yourself from interference in your business (self-sovereignty)
* Reducing the costs for the server running your instance (lightweight but secure)
* Decreasing the development time as we have ready solutions available for any kind of store

To enjoy most of these benefits, you don't even need to run a Bitcart instance yourself, you could just create an account on someone else's instance. It will be even easier to set up for free or a fee depending on the host's choice. Downside is that you will rely on the server admin to keep it functional and up-to-date.

With the growth of your business it will eventually become important to set-up your own server to be really independent.

Want to give it a try? Here is an up-to-date list of [third-party hosts](https://docs.bitcart.ai/deployment/thirdpartyhosting).

### Online Store

If you're a merchant running an e-commerce business, you can easily [deploy Bitcart](https://docs.bitcart.ai/deployment) and connect it to your store via [integration plugins](https://docs.bitcart.ai/integrations/) in just a few clicks. Or, if you don't have a store yet, you can use Bitcart's built-in store which is a ready solution which might be enough for your use case. You can start selling even without any programming!

Bitcart checkout is no different to any other payment gateway. Your customer gets an invoice. They pay it by scanning a QR code or by copy-pasting the amount and the address. When their payment is confirmed, you will be notified via your e-commerce CMS and additional configured actions will be executed, and you can ship the item. Take a look at [our demo online store](https://store.bitcart.ai).

### Physical Store

For physical stores, Bitcart has a [web-based Point of Sale](https://store.bitcart.ai) (POS) store which can be customized. Similarly to the online store, your customer is presented with an invoice that they can pay on the spot. You can create a watch-only wallet on your phone to be notified of the payments through the POS, without the need of any additional software. The POS store can be run on any web-connected device.

### Freelancers & Bill Pay <a href="#freelancers-and-bill-pay" id="freelancers-and-bill-pay"></a>

Send anyone a request for payment by creating an invoice with custom amount in your admin panel ([demo](https://admin.bitcart.ai)). With or without expiry, users can pay the invoice at any time.

![Create the invoice right from your admin panel!](/files/-MPVcf3wVE8cRzX-ZZIU)

Merchants or freelancers can use this for bill pay services. You can even use your admin panel to quickly request money from friends.

### Lightning Network payments <a href="#lightning-network-payments" id="lightning-network-payments"></a>

No matter the kind of business you run, Bitcart offers a very easy way to get started on the Lightning Network. You can use and experiment with this innovative second-layer solution build on top of Bitcoin by [following this guide](/guides/lightning). Both merchants and customers can use Bitcart to receive or make payments off-chain with instant confirmations and neglectable network fees.

## Charities and Content Creators (Donations) <a href="#charities-and-content-creators-donations" id="charities-and-content-creators-donations"></a>

Charities, non-profits, content creators, and other organizations that want to accept cryptocurrency donations in a more private way than the traditional single bitcoin address method can utilize the [Admin panel,](https://admin.bitcart.ai) and [POS store](https://store.bitcart.ai) for a better user experience.

Benefits of using Bitcart for accepting donations:

* Saving money (no fees, no subscriptions)
* Cutting out the middle-man (Payments go directly to your wallet)
* Enhancing privacy for you and your customers (no address re-use, no IP leaks to third parties)

It is particularly important to mention that Bitcart prevents address reuse, as many people has been reusing address for donations in the past. Here is why you SHOULD NOT reuse Bitcoin(or any other cryptocurrency) address:

* Privacy: reusing the same address for donations not only makes it incredibly easy to link it to your identity, it also compromises the privacy of your donators and every person that interacts with you
* Security: by compromising your privacy, address reuse increases your attack surface, as people that want to steal from you or harm you would have A LOT of information about you and your donators
* High fees: fees for a Bitcoin transaction are calculated according to the "size" of a transaction (which has nothing to do with the amount being sent). By reusing addresses, you are building huge transactions involving many inputs, that will cost you a lot in fees when you want to move them

You can read more about address reuse on the [Bitcoin Wiki](https://en.bitcoin.it/wiki/Address_reuse).

## Local Payment Processor <a href="#local-payment-processor" id="local-payment-processor"></a>

When you deploy a self-hosted Bitcart instance, you can attach and create an unlimited number of stores and apps. This means when you launch Bitcart, you can become a payment processor for your family members, friends or your local community. You can do that to promote Bitcoin or other cryptocurrencies amongst people you know or to help out people that can't rely on other solutions.

While you're allowing them to rely on your Bitcart core instance, the payments go directly to their wallets, and you have zero control over their funds at any point in the transaction, and cannot charge a processing fee. You can, however, develop a registration paywall and charge monthly fees.

Take a look at the list of [third-party hosts](https://docs.bitcart.ai/deployment/thirdpartyhosting).

## Cryptocurrency Exchanges <a href="#cryptocurrency-exchanges" id="cryptocurrency-exchanges"></a>

The number of merchants using Bitcart grows each day, and cryptocurrency exchanges could benefit from it by developing integration with Bitcart and allow instant conversion of cryptocurrency payments into local fiat currencies.

Being an open source project, Bitcart doesn't have the power to impose anything on exchanges, meaning that any of them could build on top of it, regardless of their size or the country they operate.

## Hosting Providers <a href="#hosting-providers" id="hosting-providers"></a>

Hosting providers can (and some already did) create easy 1-click Bitcart deployment solutions for their customers. With the growing interest in Bitcart, hosting companies can tap into this source of new customers and make money by hosting easily-deployable Bitcart instances for merchants.

## Developers

Bitcart community is amiable and open-minded. Developers can not only learn a lot and get their name out by working on an open-source project, but also participate in transforming the payment processing business.

Bitcart source code is a great source of learning, as it utilizes the modern and demanded tech stack. It has already helped many people in learning something: testing and TDD, docker, APIs building, and many more! Join us and discover many great things in tech world!

These are some of the many ways in which you can use Bitcart. Unleash your creativity and feel free to build your own solutions to solve problems.


# Walkthrough

In this article, we will walk you through the Bitcart admin panel user interface and show you how to navigate through different options.

When creating an account, if you're the first user registered on the instance, you'll be granted superuser rights (full control over the server). On third-party hosts it is usually not so, but if you're hosting your own instance you'll of course become the full owner of it.

After you created the account on the Bitcart instance hosted by yourself or a third-party, you'll see a lot of information cards.

![Information cards in your admin panel](/files/-MP_VNCVyQ_N4QOTZHcj)

Note about the night mode of the panel. By default, admin panel uses day mode, but if in your local time it is from 8 pm to 6 am, night mode will be enabled automatically 😉 You can configure it by clicking the moon icon in the top right corner of the page.

![Admin panel's day mode](/files/-MP_VpL1XKQwfsIw5T48)

Each information card contains summary about something in your account: wallets, stores, products, invoices, etc.

By clicking Details button in any of the cards you will be able to see full information about specific unit.

Note, wallets balance is displayed not in BTC, but in abstract currency. It is a sum of all your balances in different currencies.

If you're a superuser, you can click on profile icon in the top right corner of the page to visit server settings page.

![Server management button](/files/-MP_WEuj_XGc6NzY5VhB)

From server settings page, you can control the users of your server, and many more. For more information, check [Server Settings FAQ](/support-and-community/faq/server-settings-faq)

Now, to the other common settings.

Each page basically contains one common thing - a datatable.

It is a feature-rich datatable, supporting searching, ordering, create/edit/delete actions, batch actions, and some additional actions depending on what page you're on. For example, on stores page, you can configure email settings for a store by clicking email icon in actions column.

![Actions example](/files/-LzN7fahy5vsTumTQkYV)

## Wallets

The core of Bitcart is creating a wallet. In Bitcart, one wallet represents one currency.

Default currency is btc, you can change that. When creating wallet, just select currency code from the ones available on your instance (btc,ltc etc.). Wallets may have a name and their [xpub](/support-and-community/faq/terminology-faq#what-is-an-xpub).

The nice feature of Bitcart is that it does not require your private keys, but it supports many different formats.

You can enter (x/y/z)pub - public key, (x/y/z)prv - private key, or even electrum seed - providing easiest migration possible from many wallets, especially electrum. If you don't have an xpub yet, we recommend you create a wallet somewhere. [Electrum](https://electrum.org) wallet provides the best integration with Bitcart, check [Architecture page](/development/architecture) for more information.

When creating a wallet, it will get synced very fast (depends on the size of the wallet, but shouldn't take too long), and Bitcart will fetch it's balance and display it.

![Wallets page](/files/-MPeIGrPgRpc4SpTziJh)

![Create wallet pop-up](/files/-MPeIUu1Aoh8871M0j9y)

By clicking arrow near any of the rows, you can view some additional details, like wallet xpub.

![Wallet details](/files/-LzN8QobMIpb_QhHpxlh)

## Stores

You can create unlimited amount of stores in Bitcart.

Each store can contain any amount of products and associated invoices. Store is a base entrypoint for anything related to checkout.

Store may have multiple wallets connected. That way, connecting different wallets with different base currencies, you can achieve multicurrency checkout.

Selecting multiple wallets of the same currency is **NOT** recommended. On invoice creation, Bitcart will pick the first wallet of that currency, returned by database(they might be returned in any order).

![Stores page](/files/-MPeIsxi5DOIVksJHNgV)

![Create store pop-up](/files/-MPeJ4-HrUYCT0cfNOhe)

If you want to send customers invoices on successful checkout, you should configure email server.

To do that, click on email icon in actions column, and enter SMTP server details.

Store email is the email used to send messages from, and the display email in Bitcart POS store.

Email host, port, login and password are credentials for your SMTP server. Email host shouldn't include any http\:// or https\:// parts. If your SMTP server requires TLS, turn on SSL/TLS switch.

When done(you should click save button first), click on Test ping button to see if your setup is working.

Note for gmail SMTP servers, you should enable access by turning on [less secure apps](https://myaccount.google.com/lesssecureapps) (it is still secure, gmail apps aren't the requirement). You might also need to [allow access](https://accounts.google.com/DisplayUnlockCaptcha) on a new account.

From the email settings pop-up, you will also be able to load a ready preset for some popular email server providers.

![Email server settings](/files/-MPeJo0-bnXUXhFGgJbD)

Your store is the main configuration point for all the further actions with it, like invoice creation.

You can configure different policies from your store settings.

### Store checkout settings

By clicking on settings icon, you will be presented with the store checkout settings pop-up, where you can change different settings affecting the checkout.

* Invoice expiration time, in minutes. It affects the timer displayed in the checkout. It is the time in which the customer must send the payment, otherwise invoice is marked as expired
* Use HTML templates - whether to render templates of email message sent to customer as html or as plain text. For more information, see this [guide](/guides/templates#html-templates).

![Store checkout settings](/files/-MPeLor1IXbf0MPgecZ6)

## Discounts

It is optional page for your initial setup, you may skip it for now.

In many cases you might want to add some discounts to your store. New year discounts, other holidays? Limited time promocode discounts? Discount when paying in your preferred currency? Anything is possible with Bitcart.

Just provide a percent(integer) for your discount, and discount apply conditions:

* promocode(optional, when not provided discount is always applied when other conditions succeed)
* end date
* currencies(comma separated list of currency to apply to, or empty to apply to all currencies)

You can link discounts to products in the products page.

When one invoice at creation time has matched multiple discounts, Bitcart will pick the best discount(by percent).

![Discounts page](/files/-MPeMEwBM03_3cVVc0oJ)

![Create discount pop-up](/files/-MPeMUdvpAD5QnRTNVYf)

## Products

Products are your base selling unit. Create your products, link them to your stores, add product details - and they will get displayed in your store POS!

Bitcart supports many different information for creating products:

* Amount, displayed in store POS in USD
* quantity(how many products of the same kind available)
* product category(used for filtering in store POS to classify your products)
* Discounts applied to the product(see previous section)
* Product status(like in stock, not available, up to you)
* Download url(for digital content, will be sent to customer in email)
* Store, from which to take wallets and other information
* Date of creation(auto-filled)
* Product image(supports cropping, rotating and many more!)
* Product description

![Products page](/files/-LzNEkI3OXRAsYpPcrX4)

![Image preview](/files/-LzNEwvFOlwb1N5UXMMB)

![IDs of connected discounts](/files/-LzNF21nQVQp85AmWjV1)

![Click on any ID to copy it](/files/-LzNF7ez7U9dCXbuBTs7)

![Create product pop-up](/files/-LzNFCz6z1BPuFLVRzEF)

![Create a perfect image for your product (:](/files/-LzNFHh0mbF9fXNdvKD5)

![Store POS reflecting entered products information](/files/-LzNLF2jjLRcrICH7xZ_)

## Invoices

This page can be used to monitor your paid invoices, create new invoices and send them to friends, or to pay an invoice.

Supported information:

* Price is the price in store's default currency, which will be converted to payment method's currency when generating payment URL
* Currency, used to override store's default currency if needed
* Store, from which to take wallets and other information
* Connected products(for store POS, optional)
* Promocode, if customer entered it during checkout process (auto-filled)
* Notification URL where to send IPN notifications on invoice status change (more below)
* Redirect URL, customer will be redirected to it after successful checkout.
* Buyer email, if customer entered it during checkout process(auto-filled)
* Order ID, used by external integrations like woocommerce, track your orders by searching for order id(auto-filled)
* Discount - ID of the discount applied during invoice creation(auto-filled)
* Invoice status, more below
* Date of creation (auto-filled)
* Payment methods - not editable fields, displaying checkout information

If your invoice contains connected products, you'll be able to know which products were bought by the customer. The name of the store will be used on checkout.

When converting to payment method's currency, destination currency's maximum decimal points is taken in mind, and the price is being formatted as per currency settings. The convert, the exchange rate is used. See this [page](/guides/fiat-currencies-support) for more information.

### Notification URL

If you fill in notification URL, Bitcart instance will send IPN notifications to that URL via a POST request.

It will send the following json data:

`{"id": invoice_id, "status": new_status}`

When invoice status changes(Pending->complete, Pending->expired, etc.), notification will be sent.

It's up to you how to process that IPN notification. You should also verify that data sent is correct, as theoretically, anyone can send that POST request if they know your IPN handler URL. So, check that sent status is the same as the one got from get invoice request.

Invoices statuses can be one of the following:

* Pending (in progress)
* complete (invoice paid)
* invalid (unexpected error)
* expired
* In progress (lightning network status)
* Failed (lightning network status)

After invoice creation, you'll be able to view checkout information by clicking show button in payment methods column. It will display a so-called "invoice preview", it is not a fully functional checkout, but just an information dialog to display payment methods(it ignores invoice status).

By clicking open checkout you'll be redirected to full checkout, respecting invoice statuses and other things. Invoice URL can be safely shared with others and used for checkout right from your admin panel.

![Invoices page](/files/-MPeRbpcR9Uba-G4d8cu)

![Create invoice pop-up](/files/-MPeS11FuYSvB-MbKZhZ)

![Preview payment methods in the admin panel](/files/-MPeSMP8vmTYzPnbKU2A)

![Invoice expired](/files/-LzNKRe-FGzGKtZzHmDb)

![Invoice paid](/files/-LzNKUjLGKreryxTcRVG)

![Full checkout page](/files/-MPeSYoRqiWCvua6xYec)

## Notification providers

On this page you can configure your notification providers, to later connect them to your stores.

Supported information:

* Notification provider name for display
* Provider to use, you can choose of many available ones
* Provider options, differing from provider to provider

![Notification providers page](/files/-MDy9GP_XgwznD11PDEu)

![Create notification provider pop-up](/files/-MDy9OYybhm7i22TY3S1)

![Choice of various providers](/files/-MDy9XBuF9Pwqbi4y9x4)

Each notification provider has different settings. Refer to their documentation about how to get certain settings. After that, select needed provider, fill in the settings and save changes.

Then you can reuse notification providers by connecting them to needed stores!

When notification provider is connected, on each successful order it will be run to deliver a notification to you.

![Connect notification provider to store](/files/-MDyA5qYum40jWcyGd_o)

![Sample notification via telegram provider](/files/-MDyAO4xb5kWqieDHZ82)

## Templates

On templates page you can override global server templates, or create custom ones.

Available fields:

* Name of template, you can select from built-in ones or type in a new one
* Template text

All templates in Bitcart are rendered via [Jinja2](https://jinja.palletsprojects.com/en/stable).

Read about it's syntax in their [template designer documentation](https://jinja.palletsprojects.com/en/stable/templates).

Read more about example usages of templates in Bitcart [here](/guides/templates)

![Templates page](/files/-MDyC2QJ2NX-6tqfkUql)

![Create template pop-up](/files/-MDyCHx6Z-cAJT1EPeu2)

![Default templates list](/files/-MDyCRqmAK-tfnghfjSj)

### Template selection rules

When a template is being requested to render (for example, when sending notification via notification providers, or composing email message), it is selected in the following order:

1. If this product or store has template connected, it will be used
2. If it has no template connected, default global store or product template will be used (named store or product), if exists
3. If none of templates above are customized, [default templates](https://github.com/bitcart/bitcart/tree/master/api/templates) are used

### Changing object's templates

On some pages, for example, stores or products pages, you will be able to edit templates per each item (per each product, per each store, etc.)\
If so, on such pages you will see the following icon:

![Edit templates icon](/files/-MDyDhcl1d_JeJ2FJFZV)

By clicking on it, you will be able to override default templates for this item. Such templates are always used the first if they are set.

![Edit default templates pop-up](/files/-MDyE0pLv0Ukvwc5TO58)

Note that in the example image above it is not necessary to connect default templates for each store, as the template we created is named notification, therefore overriding default ones for each store.

## Payouts

Bitcart supports sending funds from your connected wallets to outside sources. This can be useful for refunds for example, or in case you don't want to open a separate wallet for each currency and use universal Bitcart interface.

<figure><img src="/files/NDqnG3NBc8r2Zr0eFZyX" alt=""><figcaption><p>Create payout dialog</p></figcaption></figure>

Just enter:

* Destination
* Amount to send (in fiat currency, defaults to default currency of the store, for this screenshot it would be 1 USD)
* Store to use (used for setting some defaults like currency)
* Wallet to send from. Whether it's a smart contract or not will automatically be determined via wallet settings
* (Optional) notification url where to send IPN notifications on payout status updates (a HTTP POST request with data in format `{"id": "payout id", "status": "new status"}`
* (Optional) Maximum fee (in fiat currency selected). If predicted fee exceeds the max fee, the payout will halt.

When saving a payout, it won't be sent automatically. It will be set to pending status, waiting for your approval. There are a few statuses for you to use:

pending (just created), approved (manual approval by you, not sent yet), cancelled (manual cancel by you, not sent), sent (payout is sent, tx hash is available, transaction not confirmed yet), complete (payout is sent and confirmed, used fee is available in payout details), failed (something failed during payout sending)

<figure><img src="/files/ZCYnxsNGTIxuMxYsUG96" alt=""><figcaption><p>Payout details after it is complete (note: tron blockchain actually allows free transactions)</p></figcaption></figure>

### Signing payouts

By default, all wallets in Bitcart are watch-only. We typically only require an address or xpub for payment processing needs. Private key is never required. In case you use the payouts feature, you will be able to connect relevant wallets used with their private keys. Signing will be done in a special "diskless" mode, where all operations will be performed in memory, with no data saved to disk.

But in case your wallet was created as a hot wallet, it will be used automatically without the need to supply it (note that in this case, as per regular wallet loading operations, the keys will be saved on disk)

<figure><img src="/files/PPb6IGzzVSoXz1OR1lmP" alt=""><figcaption><p>Sign payout dialog</p></figcaption></figure>


# Bitcart vs others

Most new merchants will likely only consider the price of the service. Since Bitcart is free, that may have led you here and if so, welcome.

First of all, as said above, Bitcart is fully free, fully opensource and has no limitations. You are your own bank.

The second main difference is that other services are usually providing only one thing - rate-limited API or a web interface. But Bitcart, as opposed to others, is a full-featured solution, all-in-one crypto solution. It can satisfy needs of any audience:

* Developers, having daemons for bitcoin and other coins, and [SDK](https://sdk.bitcart.ai) sharing same APIs for any coin, easy to create any kind of app(for example atomic [tipbot](https://t.me/bitcart_atomic_tipbot))
* Merchants, providing ready solutions for your stores to accept cryptocurrency payments with the simplest setup
* Server maintainers, providing simplest setup with a diversity of deployment options, with automatic updates (github release -> docker hub -> end machines)
* Anyone else wanting to try out cryptocurrencies

Bitcart is a light self-hosted solution. It is as safe(even safer than most) as other solutions, but is light, easy to use and install.

How did we achieve this? Bitcart is using the electrum wallet internally(see [Architecture page](/development/architecture) for more information). Electrum wallet is one of the oldest and the most secure and feature-wide wallets. It is using SPV(Simple Payment Verification) to verify everything and it makes electrum and so Bitcart secure and light. If you're not satisfied with the way it works, you can host your own electrumx server and make Bitcart use only your own server. We will provide easy setup for that in near future.

Due to it's lightness, you can host Bitcart on a minimal server, with minimal costs! Current lunanode 1-click installer would cost you **3.5$ a month** to host Bitcart with all components(admin, store) and from 1 to 5 cryptocurrencies for the same price, still being light. Or you can find even cheaper hosting providers and host it even cheaper! In fact, all Bitcart demos ([store](https://store.bitcart.ai), [admin](https://admin.bitcart.ai), [api](https://api.bitcart.ai)) run on 1 GB server with only 25 GB disk.

The approximate system requirements differ, but almost any server is fine, **less than 1 GB RAM and less than 10 GB disk.**

Bitcart is made with extensibility in mind, so adding something new is easy. Written in Python, it's code is **easy to review and read**, adding new features is **faster** than in other projects.

Bitcart is also a great source of **learning**. We use many different technologies, creating the best User Experience. During the process of development, we met many different problems and solved them in elegant ways. You can learn those ways, and the technologies used, and become a **professional developer**.

Bitcart provides a ready full-featured merchants solution - Bitcart [store](https://store.bitcart.ai). You can get up and running without any technical knowledge for minimal ever price(depending on VPS provider you have selected).

The list of the reasons why you should use Bitcart can go on and on. Now some features of it as a payment processor:

* [Features](#features)
* [Cost](#cost)
* [Security](#security)
* [Privacy](#privacy)
* [Decentralized](#decentralized)
* [Fiat](#fiat)

## Features

Every payment processor has features, here are some Bitcart features:

* **Free** - No merchant processing fees.
* **Bitcoin** - Accepting Bitcoin is the first step.
* **Altcoins** - Accept cryptocurrency alternatives to Bitcoin.
* **Lightning** - Rapid Bitcoin microtransactions using the Lightning Network.
* **Integrations** - Wordpress & WooCommerce and custom integrations.
* **Point Of Sale** - POS Interfaces for physical stores.
* **Unlimited Stores** - Merchants can process payments for their own stores, or for others.
* **Payment Requests** - Create & send a long-lived invoice requesting payment for goods or services.
* **Ready solutions for starting merchants** - your own store and admin panel.
* **Solutions for checkout flow automation** - you can create scripts to process the order for you.

## Cost

It's important to note that payments made using the Bitcoin Network *always* require a transaction (miner) fee for it to be included in the blockchain. The Bitcoin Network determines if the transaction is authorized and when it is confirmed.

Bitcart creates direct payment invoices for merchants to provide to their customers. It also monitors the blockchain and stores the confirmation status of each payment or donation. To do this Bitcart requires hosting on a server which merchants can deploy on their own hardware, purchase a VPS (less than $3.5/mo), or use someone else's Bitcart instance to host your account (free or paid options).

If you deploy Bitcart using a VPS, the following types of fees are **never charged**:

* Merchant fees
* Subscription fees
* Transfer fees
* Software fees

## Security

First rule of Bitcoin is always keep your private keys *private*. Using a secure wallet is recommended for new merchants as the only provider (creator) of private keys. If there is a chance that someone else (such as a website) knows, stores, or provides your private keys to you, it's generally accepted that they are not actually private.

Secondly, there is another area of security to consider on the applications layer where you have two main options:

* **Option 1**: Most payment processors (including Bitcart) use the [BIP 21](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki) standard.
* **Option 2**: Others use variations of the [BIP 70](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki) standard.
  * **Note**: [BIP 70 has recently been deprecated in Bitcoin Core](https://github.com/bitcoin/bitcoin/pull/14451).
  * Many wallets do not allow payments to BIP 70 invoice urls.

## Privacy

Bitcart will never ask a merchant for any personal identification.

Typically, when converting to or from fiat on behalf of a merchant, payment processors are required to collect personal information for Know Your Customer (KYC) and Anti-money laundering (AML) banking requirements. This may include personal information such as passport ID, phone number, address, bank account, etc.

Fortunately, the Bitcoin Network does not use or collect these types of personal information, and therefore neither does Bitcart. How Bitcart ensures privacy:

* No middleman involved.
* Information is shared between customer and seller only.
* Self-hosted users run a secure Bitcart core or [a full node](https://en.bitcoin.it/wiki/Why_Your_Business_Should_Use_a_Full_Node_to_Accept_Bitcoin).
* No address re-use.
* Any non-decentralized solutions are avoided, instances are self-contained.

## Decentralized

Many payment processors claim to have no middleman. They claim that funds go directly to your wallet or that they offer instant settlement. However, if the processor makes any of the following claims, they are most likely operating as a **middleman**:

* Waiting time for a merchant to receive payment is longer than sufficient blockchain confirmation.
* The payment processor combines customer payments before sending to the merchant's wallet.
* If there are any kind of limits on transaction volume for the merchant.
* If the payment processor can decline, reject or alter a payment after being sent from a customer's wallet.
* If the payment processor has terms and conditions stating they can hold or freeze your account.
* Fees for using the payment processor are automatically taken out from the customer's payment to the merchant.

Payment processors are able act as middlemen by using **custodial wallets**. A payment processor can use an internal custodial wallet for altering customer payments before routing them to merchants. This is how they can collect fees, hold payments for verification and processing, etc. This type of wallet is an intermediary between the merchant wallet and the customer wallet. It's the middleman wallet.

The payment processor may also provide a custodial wallet for the merchant to use. As mentioned above, this is advised against because your private keys may be compromised. If they claim to not save your private keys after giving them to you, it's likely you will not know the truth until it's too late. Centralized services may seem like an easier solution for the merchant. Unfortunately the trade-off is sacrifices in privacy, security and self-sovereignty which is normally obtained using the Bitcoin Network.

That's one of the reasons why Bitcart was created. To help merchants remove third party dependencies and simply use the Bitcoin Network freely and securely. Merchants have their own copy of the Bitcart software which runs on their own server or VPS of their choice and validates their own payments using their own node. It's a self-hosted Peer-to-Peer all-in-one crypto solution. There shouldn't be any trade-offs as setup is the simplest possible and we wanted to make this software user friendly.

As the Bitcart community continues to grow, more deployment methods, use cases and tutorials are continually being added to make it easier for non-technical users. Bitcart is completely open source. Anyone can join the community to suggest or create improvements, features, guides, etc. Feedback is always welcome.

## Fiat

Currently, Bitcart is a processor **without fiat conversion** capabilities. As a merchant, this may be a difficult if business costs require fiat. Not providing fiat conversion allows Bitcart merchants to avoid KYC and AML identification verification. This also allows Bitcart to be free and available for anyone to use.

However, a fiat conversion feature is on the roadmap for Bitcart. Since merchants are always the owners of their private keys, they can always freely convert their coins manually, but for now there's no instant-fiat conversion.

## Can't find this information for other payment processors? <a href="#cant-find-this-information-for-other-payment-processors" id="cant-find-this-information-for-other-payment-processors"></a>

* It's probably a feature not a bug!
* All of this information should be available to merchants.
* Checkout the [Awesome Payment Processor List](https://github.com/alexk111/awesome-bitcoin-payment-processors)
* If you have more questions about Bitcart, read our [Official Documentation](https://docs.bitcart.ai).


# Try it out

This section goes through the process of creating an account and store on our public Bitcart instance. (For evaluation purpose)

## Create your first invoice <a href="#create-your-first-invoice" id="create-your-first-invoice"></a>

First let's create a new store:

1. Go to the [demo website](https://admin.bitcart.ai)
2. In the login form click on **Sign up here** to [create an account](https://admin.bitcart.ai/register)

Let's use Electrum to create a mainnet wallet for your store:

1. Download [Electrum](https://electrum.org)
2. Run Electrum
3. Click through the wizard and create a test wallet, using the default settings Electrum proposes
4. After the wallet is set up, go to "Wallet" > "Information" in the Electrum menu.
5. Copy the "Master Public Key" string (starting by `*pub...`)

Let's configure the store so it uses your Electrum wallet:

1. Go to **Wallets** page and [create a new wallet](https://admin.bitcart.ai/wallets) with your copied xpub
2. Go to **Stores** page and [create a new store](https://admin.bitcart.ai/stores) with your new wallet connected
3. After that your test wallet should appear on the [Wallets page](https://admin.bitcart.ai/wallets) of your Bitcart account

Then you can create an invoice, either through

* the **Invoices** page [on the website](https://admin.bitcart.ai/invoices) or
* the process documented on the [Custom integration](/integrations/custom-integration)
* or the [store POS](/guides/store-pos), if you are the owner of the instance

## Bitcart Demo <a href="#bitcart-demo" id="bitcart-demo"></a>

To see Bitcart in action, visit our demo apps and stores or check out some of the stores using Bitcart in production.

* [Bitcart Demo Store](https://store.bitcart.ai)
* [Admin panel](https://admin.bitcart.ai)
* [Merchants API](https://api.bitcart.ai)
* [Atomic tipbot](https://t.me/bitcart_atomic_tipbot)


# Deployment

Bitcart is extremely easy to deploy on your own server!

We have the minimal requirements ever possible:

* 1 GB RAM (2 GB if enabling ETH)
* 10 GB disk
* Unix-based operating systems (something common like ubuntu is recommended)

Please refer to this diagram to choose your deployment method (you can see their descriptions in navigation sidebar at left):

![](/files/ktd404h1EGPhcfOYb8Nx)

In case you're not yet ready to choose where or how to host (it can cost as little as 3.5$ a month), you can try using Bitcart using [our demo](https://admin.bitcart.ai) or [third-party hosts](/deployment/thirdpartyhosting).


# Configurator

Bitcart Configurator allows you to easily deploy new Bitcart instances, or re-configuring existing ones, with ease and no technical skills.

Configurator demo is accessible at <https://configurator.bitcart.ai>

You can access it from your admin by clicking the configurator button.

It allows you to easily deploy a new instance by just answering a few questions.

{% embed url="<https://youtu.be/PllP3z88dCE>" %}

{% hint style="warning" %}
Configurator is designed for ease of onboarding and works only with [one domain mode](/guides/one-domain-mode).

If you have more complex setup, check out full [docker deployment guide](/deployment/docker).
{% endhint %}

## Deployment destination

There are 3 deployment destinations available: remote, manual, and current instance.

### Remote

By entering the server credentials, the Configurator will automagically connect to your server and deploy the instance, while you drink a cup of coffee!

![SSH settings](/files/-MVGmXEC7ZDcwjAE9Lp9)

![Deployment progress](/files/-MVGmzqzHO7FSTeCL0r4)

![Failed deployment](/files/-MVGn1UbYVO7zC6Ufxsn)

For an example of successful deployment, watch the video above.

### Manual

If you don't trust the configurator's server, or you just need a copiable script you can run yourself, you can use the manual mode. It generates a script for you to copy, based on selected settings.

![Copiable script](/files/-MVGmuQzUUrEQyUnyZqZ)

### Current instance

If you are the server admin, you will have access to the current instance mode. You can change settings of your current instance without logging in to your server. By clicking current instance button Bitcart loads all current settings which you can customize.

## Domains

On this page you can enter your domain where to deploy (using [one domain mode](/guides/one-domain-mode)), and optionally disable https support. If you don't have a domain, you can enable tor support in the later pages.

![Domains page](/files/-MVGn_cLTdDxl1J28esX)

## Coins

On this page you can configure and enable all the coins you want. For each coin you may enable lightning with just one click, or change network settings. Note that you must select at least one coin.

![Coins page](/files/-MVGnoSbhNCqQNLit0Nh)

![Select network](/files/-MVGnuGAyd2T4UVJu1-q)

![Enable lightning in one click!](/files/-MVGnxImqkC3mTEI72QE)

## Additional

On the additional page, you may enable additional plugin packs, for example, Tor support.

![Tor support](/files/-MVGo7Xfdocwz9c8WS0R)

## Advanced

On this page you can configure advanced parameters. If you don't need to edit them, skip to the next page.

You can choose an installation pack (all, backend, frontend or none), and add more custom components, or edit the bitcart-docker repository URL.

![Advanced page](/files/-MVGoSsP58Cn73Nt7zuu)

![Additional components](/files/-MVGoVgqPxdtkYWe195d)

## Summary

On this page you can preview settings used. If something is wrong, you will see warnings.

When you are ready, click continue.

![Summary](/files/-MVGoiQYyB42ldLd_F2n)

![Warnings](/files/-MVGosn91PSruqqf0PLJ)

## Deploy stage

After clicking continue, you will either see a ready script, or a progress bar, while configurator is deploying a new instance. Refer to each deployment destination for more details.


# Docker Deployment

{% hint style="info" %}
You may check out an easier method: [Configurator](/deployment/configurator)
{% endhint %}

Bitcart uses docker for deployment. This allows us to simplify the installation and make Bitcart installable in almost any environment.

Currently Bitcart runs on 2 architectures: amd64 (most PC and servers), arm64 (raspberry pi). Arm32 is not supported officially anymore.

Almost every docker deployment starts like that:

```bash
sudo su -
git clone https://github.com/bitcart/bitcart-docker
cd bitcart-docker
# export needed settings, for example
export BITCART_HOST=yourdomain.tld
./setup.sh
```

{% hint style="warning" %}
Note the minus sign after `su`. It is required. If you are deploying on mac os, you don't need to enter the first command. This is to load all settings
{% endhint %}

There are different environment variables available in order to customize the deployment

{% hint style="info" %}
In order for Bitcart to work, if you use `BITCART_HOST`, you should create a DNS A (and/or AAAA if you have [IPv6 support](/deployment/docker/ipv6-support) enabled) record from your domain registar, pointing to your current server
{% endhint %}

Environment variables are set like so:

```bash
export VARIABLE_NAME=value
```

Here are the main ones:

* `BITCART_HOST` configures on which domain Bitcart should run. It is required unless you use any of the methods from [local deployment](/deployment/local). It works in [one domain mode](/guides/one-domain-mode). Your Bitcart Store will be accessible at `BITCART_HOST`, admin panel at /admin and Merchants API at /api. For other ways of configuration (for example different servers), check the one domain guide
* `BITCART_CRYPTOS` configures which coins to enable. It is a list of coin symbols separated by commas. By default only btc is enabled. For example, to enable btc and eth, you would run `export BITCART_CRYPTOS=btc,eth`
* `BITCART_REVERSEPROXY` - configures the reverse proxy used. By default `nginx-https` is used (with automatic ssl certificates generation). It might be useful to disable it to access your services directly or you can set it to `nginx` to disable ssl
* `BITCART_ADDITIONAL_COMPONENTS` - you can add additional components to your deployment. For example, using `export BITCART_ADDITIONAL_COMPONENTS=tor` enables tor.

There are also quite a few settings related to configuring coins in Bitcart. Each coin has the same set of settings you can configure:

* `COIN_NETWORK` changes on which network the coin runs. For example: `export BTC_NETWORK=testnet` would enable testnet in BTC coin with no other changes required!
* `COIN_LIGHTNING` enables lightning network for coins which support it (BTC-based). For BTC you would do: `export BTC_LIGHTNING=true`
* `COIN_DEBUG` enables debug mode for daemons to log more information. For example `export BCH_DEBUG=true`
* `COIN_SERVER` configures the daemon to use exact server you specify instead of connecting to many servers at once. For example `export BNB_SERVER=https://bsc-dataseed.binance.org` For btc-based coins, you can set up your own [ElectrumX](https://github.com/spesmilo/electrumx) or [Fulcrum](https://github.com/cculianu/Fulcrum) server with your own full node. For eth-based coins, server is your full node's RPC url.

For the complete list of configuration settings you can use (to e.g. open some ports, change networks used or anything else), check out full configuration description at [bitcart-docker github](https://github.com/bitcart/bitcart-docker/blob/master/README.md#configuration).


# IPv6 Support

{% hint style="info" %}
Remarkably, this setup allows hosting Bitcart in IPv6-only environment! You can [proxy Bitcart using Cloudflare](/proxying-bitcart/cloudflare), just add DNS AAAA record and enable proxy ("orange cloud"). This being will enable serving IPv4-only customers even without having dedicated IPv4 address.
{% endhint %}

To enable IPv6 support in Bitcart for Docker deployment, changes to Docker daemon must be applied. In the file `/etc/docker/daemon.json`, the following parameters must be added:

* `"ipv6": true`
* `"fixed-cidr-v6": "2001:db8:1::/64"`
* `"default-address-pools"`:

```json
"default-address-pools": [
  {"base":"172.17.0.0/16","size":16},
  {"base":"172.18.0.0/16","size":16},
  {"base":"172.19.0.0/16","size":16},
  {"base":"172.20.0.0/14","size":16},
  {"base":"172.24.0.0/14","size":16},
  {"base":"172.28.0.0/14","size":16},
  {"base":"192.168.0.0/16","size":20},
  {"base":"2001:db8::/56","size":64}
]
```

Please note that `2001:db8:1::/64` and `2001:db8::/56` must be changed to the IPv6 prefix provisioned by your hosting provider. Final file should look a similar way:

```json
{
  "ipv6": true,
  "fixed-cidr-v6": "2001:db8:1::/64",
  "default-address-pools": [
    {"base":"172.17.0.0/16","size":16},
    {"base":"172.18.0.0/16","size":16},
    {"base":"172.19.0.0/16","size":16},
    {"base":"172.20.0.0/14","size":16},
    {"base":"172.24.0.0/14","size":16},
    {"base":"172.28.0.0/14","size":16},
    {"base":"192.168.0.0/16","size":20},
    {"base":"2001:db8::/56","size":64}
  ],
  "log-driver": "json-file",
  "log-opts": {"max-size": "5m", "max-file": "3"}
}
```

After saving `/etc/docker/daemon.json` configuration file, ensure to apply the new settings:

```bash
sudo systemctl restart docker
```

{% hint style="warning" %}
If you are running Bitcart behind another reverse proxy (e.g. Caddy, Nginx), ensure to refer to the [custom reverse proxy guide](/proxying-bitcart/custom-reverse-proxy) as well. In that case, it is better to enable IPv6 only on the reverse proxy itself, rather than in Bitcart. To do so, add the following to your Docker Compose file for the reverse proxy's network:

```yaml
networks:
  default:
    enable_ipv6: true
```

This way, Bitcart does not need the `opt-add-ipv6` component at all.
{% endhint %}

The last step is to enable IPv6 support in Bitcart:

```bash
cd
cd bitcart-docker
export BITCART_ADDITIONAL_COMPONENTS=opt-add-ipv6
./setup.sh
```

{% hint style="warning" %}
If you have some other additional components enabled, ensure to list all of them using comma, for example this will enable both tor and IPv6:

```bash
export BITCART_ADDITIONAL_COMPONENTS=tor,opt-add-ipv6
```

To see if you have any additional components enabled:

```bash
echo ${BITCART_ADDITIONAL_COMPONENTS}
```

{% endhint %}

Now, you are ready to add DNS AAAA record to your domain registrar or at Cloudflare dashboard.


# Local Deployment

If you want to try out Bitcart on your local machine, it is also possible. If you don't have a domain name, Bitcart provides a way to test in a local-only deployment.

The setup is almost the same as always (see [docker deployment](/deployment/docker)), the catch is: the domain name must end with .local. Bitcart then modifies your host machines' /etc/hosts file to make it work.

{% hint style="info" %}
This only works from the computer on which you install Bitcart directly. To access it from outside, you should either use Tor or your own domain name + static ip
{% endhint %}

Here and later we assume that you've cloned the bitcart-docker repository, entered that directory and entered root shell by using `sudo su -` (note that minus at the end, it's important!). If you're on mac os, use the scripts as your current user and don't enter root shell.

### Local setup (.local domains, only current PC)

```bash
export BITCART_HOST=bitcart.local
export BITCART_REVERSEPROXY="nginx"
./setup.sh
```

You will get the admin panel running at <http://bitcart.local/admin>, store at <http://bitcart.local> and api at <http://bitcart.local/api>. Good for testing locally/developing without all the hassles of [manual deployment](/deployment/manual). Note that if you don't use [one domain mode](/guides/one-domain-mode), it will still work.

### Tor setup (everywhere, requires tor browser)

```bash
export BITCART_ADDITIONAL_COMPONENTS=tor
./setup.sh
```

It isn't even required to set `BITCART_HOST` if tor is enabled. You can get onion addresses generated from the `compose_tor_servicesdir` docker volume. For more details check our [tor guide](/guides/tor).

It is even possible to combine both ways to be able to access both locally and from anywhere!


# Manual Deployment

The process is basically the following:

1. Install OS required libraries
2. Install python3 (3.11+)
3. Install nodejs (20) and yarn
4. Install postgresql
5. Install redis (6.2.0+)
6. Clone and run all parts of Bitcart
7. (Optional) Open Firewall Ports and Access the Sites

## Warning: Not recommended to use in production <a href="#warning-not-recommended-to-use-in-production" id="warning-not-recommended-to-use-in-production"></a>

Manual installation is NOT recommended in production. It should be only used for learning purpose.

Instead you should use the [docker deployment](/deployment/docker).

The docker deployment will provide you easy update system and make sure that all moving parts are wired correctly without any technical knowledge. It will also setup HTTPS for you.

## Typical manual installation <a href="#typical-manual-installation" id="typical-manual-installation"></a>

This steps have been done on ubuntu 22.04, adapt for your own install.

### 1) Install OS required libraries

```bash
sudo apt install libsecp256k1-dev
```

> Or the equivalent for your os package manager

More info on libsecp256k1 in [electrum docs](https://github.com/spesmilo/electrum-docs/blob/master/libsecp256k1-linux.rst) or [bitcoin core docs](https://github.com/bitcoin-core/secp256k1#build-steps)

### 2) Install Python 3

Usually it might have already been installed, but we also need pip3 and dev packages, so:

```bash
sudo apt install python3 python3-pip python3-dev
```

### 3) Install uv

uv is a fast Python package manager used to manage dependencies in Bitcart. Install it by following the official [uv installation guide](https://docs.astral.sh/uv/getting-started/installation).

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

### 4) Install Node.JS and Yarn

```bash
sudo apt install nodejs
sudo curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg -o /usr/share/keyrings/yarn-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
```

{% hint style="info" %}
If nodejs from your distro is not at least the version we require, then you should install it via [nodesource](https://github.com/nodesource/distributions)
{% endhint %}

{% hint style="warning" %}
Using a nodejs version higher than specified way work, but we officially support only 1 release series (usually current LTS)
{% endhint %}

### 5) Install PostgresSQL

Note, replace `REPLACEME` with your new postgres password.

```bash
sudo apt install postgresql postgresql-contrib
sudo -u postgres createdb bitcart
sudo -u postgres psql -U postgres -d postgres -c "alter user postgres with password 'REPLACEME';"
```

### 6) Install Redis

```bash
sudo apt install redis-server
```

{% hint style="info" %}
Ensure that your redis version is > 6.2.0. Check with `redis-server -v`.

If redis from your distro is too old, install from [official redis repository](https://redis.io/docs/getting-started/installation/install-redis-on-linux/#install-on-ubuntudebian)
{% endhint %}

### 7) Clone and prepare Bitcart components

#### Bitcart core(daemons) & Merchants API:

```bash
git clone https://github.com/bitcart/bitcart
cd bitcart
# uv creates a virtual environment in .venv for us automatically
uv sync --no-dev --group web --group production --group btc
source .venv/bin/activate
```

For any other daemon(coin) you want to use, run:

```bash
uv sync --no-dev --group coin_name
```

Where coin\_name is coin code(btc, ltc, eth, etc.).

{% hint style="info" %}
Ensure that you include all the needed groups when running `uv sync`. It doesn't remember the old state, so each time you run `uv sync` you need to include all the needed groups. E.g. for btc and eth, you need to run `uv sync --no-dev --group web --group production --group btc --group eth`.
{% endhint %}

{% hint style="warning" %}
If you are met with the following error during launch of the app/alembic: `ModuleNotFoundError: No module named 'sqlalchemy.cutils'`

It means that your system is missing python development packages or a compiler. On ubuntu `python3-dev` does exactly that.
{% endhint %}

Create a file `conf/.env` It contains all the settings. For now, we just need to set database password and enabled cryptos.

```bash
# Replace REPLACEME with your database password
# specify used cryptocurrencies with BITCART_CRYPTOS

cat > conf/.env << EOF
DB_PASSWORD=REPLACEME
BITCART_CRYPTOS=btc,ltc
EOF
```

Apply database migrations:

```bash
alembic upgrade head
```

#### Bitcart admin panel

```bash
git clone https://github.com/bitcart/bitcart-admin
cd bitcart-admin
yarn
yarn build
```

#### Bitcart store

```bash
git clone https://github.com/bitcart/bitcart-store
cd bitcart-store
yarn
yarn build
```

## Run everything

#### Bitcart core(daemons) & Merchants API:

Start daemons from the `bitcart` repo directory:

```bash
python3 daemons/btc.py
```

For any other coin, do the similar procedure:

```bash
python3 daemons/coin_name.py
```

Start api:

```bash
uv run task production
```

or, if you are deploying development instance, the below command will launch hot-reloadable api instance:

```bash
uv run task api
```

Start background worker:

```bash
uv run task worker
```

> If you want to run a specific coin on a test network or change other environment settings you can update the `.env` file in the [bitcart `conf/` directory](https://github.com/bitcart/bitcart/tree/master/conf)

#### Bitcart admin panel

```bash
cd bitcart-admin
yarn start
```

#### Bitcart store

```bash
cd bitcart-store
NUXT_PORT=4000 yarn start
```

#### Default ports

* The Bitcart API runs on port `8000`.
* Daemons on ports `5000-500X`
* The Bitcart Admin panel runs on port `3000`
* The Bitcart Store runs on port `4000`.

## (Optional) Open Firewall Ports and Access the Sites

If you are running Bitcart on your local machine - you will not need to do these steps. You can go ahead and access the system with:

* Bitcart Admin Panel: `http://127.0.0.1:3000/`
* Bitcart Store: `http://127.0.0.1:4000/`
* Bitcart Merchants API: `http://127.0.0.1:8000/`

If you are running Bitcart on a remote machine, you will need to do additional things to access them.

#### Option 1: Nginx proxy (Recommended)

This option is recommended to proxy secure incoming requests to the correct bitcart process.

Ensure to add `BITCART_ADMIN_API_URL` environment variable to Bitcart admin, i.e `BITCART_ADMIN_API_URL=bitcart-admin.<mysite>.com yarn start` if accessing from remote machine.

Install Nginx

```bash
sudo apt install nginx
```

Add configuration for each component: bitcart-store, bitcart and bitcart-admin

```nginx
vim /etc/nginx/sites-available/bitcart-admin.conf

server {
    server_name bitcart-admin.<mysite>.com;
    access_log /var/log/nginx/bitcart-admin.access.log;
    error_log /var/log/nginx/bitcart-admin.error.log;

    location / {
        proxy_pass http://localhost:3000;
    }
}
```

Enable the config

```bash
sudo ln -s /etc/nginx/sites-available/bitcart-admin.conf /etc/nginx/sites-enabled
```

> Add DNS records for your server names to point to your VM's ip

Check the config and reload nginx

```bash
sudo nginx -t
sudo systemctl reload nginx
```

Add TLS certificates with the letsencrypt CA for the sites

```bash
sudo apt install certbot
sudo certbot --nginx
```

Now you should be able to access the components over TLS. You can then also enable `http2` in your nginx configuration if you want.

> You might want to look at the [FAQ for more detailed info on the Nginx configuration options](/support-and-community/faq/deployment-faq#can-i-use-an-existing-nginx-server-as-a-reverse-proxy-with-ssl-termination)

#### Option 2: No proxy

If you have a firewall, you will want to open ports `3000`, `4000` and `8000`. Using `ufw` as an example:

```bash
sudo ufw allow 3000
sudo ufw allow 4000
sudo ufw allow 8000
```

> `yarn` is listening on localhost `127.0.0.1` by default and you won't be able to access it over the internet unless you reverse proxy it with `nginx`. If you want to expose it without reverse proxy, use the environment variable: `NUXT_HOST=0.0.0.0` to listen on all interfaces.

The store and admin site need **public** access to the bitcart api (URL should be resolvable both client and server side).

Using the manual method you need to set that with environment variables. The complete setup of the Bitcart Admin Panel and Store may look like this:

```bash
# bitcart-admin
NUXT_HOST="0.0.0.0" BITCART_ADMIN_API_URL="http://bitcart-api-ip:8000" yarn start
# bitcart-store
NUXT_PORT=4000 NUXT_HOST="0.0.0.0" BITCART_STORE_API_URL="http://bitcart-api-ip:8000" yarn start
```

> Note: The above is the minimum to make it work and not a production grade solution. We still recommend to use docker deployment unless you really know what you're doing.

**Access the site remotely**

* Bitcart Admin Panel: `http://my-bitcart-admin-ip:3000/`
* Bitcart Store: `http://my-bitcart-store-ip:4000/`
* Bitcart Merchants API: `http://my-bitcart-store-ip:8000/`

Continue with: [Your first invoice](/your-first-invoice)

## (Optional) Managing Processes

If you want the procaesses: bitcart api, daemons, worker and frontend (bitcart admin and bitcart store) to be managed with automatic startup, error reporting etc then consider using [supervisord](http://supervisord.org/) or [systemd](https://systemd.io/) to manage the processes.

## Upgrading manual deployment

Note: it is recommended to use docker deployment for easy upgrades.

To upgrade manually, follow the following steps:

### 1) Stop everything already running

Merchants API, workers, daemons, Admin panel and Store should be stopped

### 2) Pull latest changes

Run :

```
git pull
```

For every Bitcart component directory (Merchants API, Admin Panel, Store).

### 3) Upgrade dependencies

#### Bitcart core(daemons) & Merchants API:

```bash
uv sync --group web --group production --group btc
```

For any other daemon(coin) you want to use, run:

```bash
uv sync --group coin_name
```

Where coin\_name is coin code(btc, ltc, eth, etc.).

{% hint style="info" %}
Ensure that you include all the needed groups when running `uv sync`. It doesn't remember the old state, so each time you run `uv sync` you need to include all the needed groups. E.g. for btc and eth, you need to run `uv sync --no-dev --group web --group production --group btc --group eth`.
{% endhint %}

**Bitcart admin**

```
yarn
```

**Bitcart store**

```
yarn
```

### 4) Apply new database migrations

In Bitcart core(daemons) & Merchants API directory, run:

```
alembic upgrade head
```

### 5) Rebuild store and admin

For Bitcart Admin Panel and Store, run:

```
yarn build
```

### 6) Start everything again

Follow instructions [here](#run-everything)


# Hardware Deployment

Sometimes you might want to run Bitcart on your own hardware. This is a bit more complicated than using a VPS. But in the end you will get way better security and control over your data.

Note that no matter where you host Bitcart, as your private keys are never required, your data is always safe, you can export and move the data to any server. So if you started on a VPS, you can use our [backups feature](/guides/backups) to create a backup of all your data and restore on your own hardware.

### Requirements

Here are the requirements for running Bitcart on your own hardware:

1. High-speed internet connection. The faster the better. This is to ensure the speed of invoice detection
2. Any hardware ever. Yes, that's right! You can use your old PC or basically anything for that. Our minimal requirements are 1 GB RAM and around 10 GB disk. AMD64 hardware is the most tested one, but if needed, refer to our [raspberry pi guide](/deployment/raspberrypi)
3. Any linux-based OS would suffice, but using something like Ubuntu 20.04 is the most common choice.
4. (Optional) Static ip - that's required only if your setting up with your own domain name. If you only plan to use bitcart locally/via tor, this is not needed
5. (Optional) Domain name - see the note above

### Setup

This guide assumes that you have static ip set up and your own domain name. If not, refer to the [local setup guide](/deployment/local).

* Configure static IP in ubuntu via something like [this guide](https://linuxconfig.org/how-to-configure-static-ip-address-on-ubuntu-18-10-cosmic-cuttlefish-linux)
* If you have a domain name, create a DNS A record pointing to your static ip address (tip: you can get it if you type `whatsmyip` in google)
* Set up port forwarding on your router for ports 80 and 443 to your machine ip address. Every router is different, usually there are guides existing on any model
* Recommended: install ssh server, configure firewall and fail2ban (to prevent excessive failed logins from random ips on the internet):

```bash
sudo apt update
sudo apt install -y openssh-server fail2ban git ufw
sudo ufw allow from 192.168.1.0/24 to any port 22
sudo ufw allow 80, 443
sudo ufw status
sudo ufw enable
```

{% hint style="info" %}
You should replace 192.168.1.0/24 with your own subnet. This is to allow ssh connections only from your local network. You may not need it.
{% endhint %}

* Clone and install Bitcart (replace bitcart.yourdomain.com with the actual domain name):

```bash
sudo su -
git clone https://github.com/bitcart/bitcart-docker
export BITCART_HOST=bitcart.yourdomain.com
./setup.sh
```

{% hint style="info" %}
You may customize additional settings by `export`'ing more things. For example, use `BITCART_CRYPTOS` to customize the list of coins enabled. For the full list, see [docker deployment page](/deployment/docker#configuration)
{% endhint %}

* All done! Enjoy your Bitcart instance! If needed, check out [backups support](/guides/backups) on how to restore the data from your previous instance.


# Raspberry Pi Deployment

Raspberry Pi is a good low-power solution to host Bitcart at home. It is quite cheap and you can use it to build a lot of custom stuff.

We recommend using the latest RPI4, but RPI3 would be good too.

What's good is: Bitcart can work with any RPI flavour, even 1 GB RAM is enough to run Bitcart. Though we recommend picking up a bit more (2 GB) just to avoid slowdowns.

As for the disk, SD card, USB memory or SSD - it doesn't matter, just know that SSD is usually faster. Basically any disk on the market should have enough space (10 GB)

### Important note about 32-bit operating systems

It is recommended that you install 64-bit version of raspberry pi OS, as it is tested natively via our CI systems. 32 bit version is obsolete and is no longer officially supported. But if you want to stay 32 bits, note that on debian modern docker images may fail to start, although we try to fix that bug in our setup scripts.

### Setup

We won't provide the details of how to install OS on your RPI, but raspbian should work fine. Check those guides for [getting started](https://www.raspberrypi.com/documentation/computers/getting-started.html) and [downloading an OS image](https://www.raspberrypi.com/software/)

Open a terminal on your RPI if you have connected a display to it, or ssh to your RPI.

**Start a root shell**: `sudo su -`

* Upgrade your system, install firewall and secure your pi from unnecessary ssh spam:

```bash
apt update && apt upgrade -y && apt autoremove
apt install -y ufw fail2ban git
sudo ufw allow from 192.168.1.0/24 to any port 22
ufw allow 80, 443
ufw status
ufw enable
```

{% hint style="info" %}
You should replace 192.168.1.0/24 with your own subnet. This is to allow ssh connections only from your local network. You may not need it.
{% endhint %}

* Clone and install Bitcart

```bash
git clone https://github.com/bitcart/bitcart-docker
cd bitcart-docker
export BITCART_HOST="raspberrypi.local"
export BITCART_REVERSEPROXY="nginx"
./setup.sh
```

{% hint style="warning" %}
Ensure that your local computer you'll be accessing your Bitcart from /etc/hosts entry for raspberry pi matches BITCART\_HOST. Or instead set BITCART\_HOST to your raspberry pi ip address directly.
{% endhint %}

* That's it! You can now access Bitcart store at <http://raspberrypi.local>, admin at <http://raspberrypi.local/admin>, api at <https://raspberrypi.local/api>. For other ways of deployment (your own domain/tor) check [docker deployment](/deployment/docker) and [tor support](/guides/tor)


# Third-Party Hosting

A third-party host is someone who runs Bitcart instance and enables registration for other users. They might be free (but could accept donations) or with paid access.

Sometimes it's hard for users to deploy a new instance, but they want to try right away. That's what third-party hosts are for.

In general, it's not recommended to use them especially if you plan to scale your business, but it's great for testing.

Our demo at <https://admin.bitcart.ai> showcases all coins Bitcart supports, but we don't recommend using it for commercial purposes.

There are some hosts ran by others

### List of third-party hosts

* [admin.bsty.business](https://admin.bsty.business) (BTC, BSTY, free)

### How do I get added to that list?

You can contact us in one of [our communities](https://bitcart.ai/#community). Your server should have enabled server registration in server management settings.

![Disable server registration checkbox is off](/files/FQYhvCHxed689PfKhe3V)

### What are the limitations of this?

The only limitation is that you won't be able to access server management pages. Other than that, it's pretty much the same unless server owner has forked Bitcart. Check [this guide](/guides/server-management-settings) for details on server management settings.

### Is it safe?

Well, in most cases yes, but you should be aware of scams! People might fork Bitcart and customize it to be malicious. We never intercept the payment process and never require a private key (except for lightning network). Also, watch your wallet to check if the host replaced your public key with their own! Some public hosts also handle a lot of customers of different services, so if you self-host one yours won't be that loaded.


# Hosting Bitcart behind CDN or reverse proxy


# Cloudflare

Deployment of Bitcart on Cloudflare is straightforward.

Bitcart includes ready preset for any scenario.

First, ensure that you have configured DNS A record pointing to your server. Proxy status should be proxied if you want your server ip to be hidden. This way someone checking ip address of your domain will see cloudflare ip, and not your servers'. This is good for e.g. DDOS protection.

Visit [DNS configuration](https://dash.cloudflare.com/?to=/:account/:zone/dns/records) and add the record, in our case, bitcart.

<figure><img src="/files/M4Wfp6llMWJP4loWyxID" alt=""><figcaption><p>Creating DNS a record</p></figcaption></figure>

```bash
sudo su -
git clone https://github.com/bitcart/bitcart-docker
cd bitcart-docker
export BITCART_HOST=bitcart.yourdomain.tld
./setup.sh --preset cloudflare
```

And that's it! In a few minutes, Bitcart should be up and running. It automatically configured proper settings behind the hood.

It should work with default Cloudflare SSL settings (it should detect mode Full).

If not, visit [SSL/TLS configuration page](https://dash.cloudflare.com/?to=/:account/:zone/ssl-tls) and set it to Full.

<figure><img src="/files/r9mJuWrFTJQ0AmiKGmz8" alt=""><figcaption><p>SSL mode full</p></figcaption></figure>

If you are running a reverse proxy on your server, you should use&#x20;

```bash
./setup.sh --preset cloudflare-proxied
```

Instead of default cloudflare preset. And ensure to follow instructions in \[Custom reverse proxy]


# Custom reverse proxy

If you want to run Bitcart on a server which already has a reverse proxy (nginx, caddy) running, this usecase is supported as well!

There are a few approaches to running multiple services on one server. For ease of use and proper configuration we recommend [Caddy](https://caddyserver.com/).

## Using TLS forwarding (recommended)

This approach requires you to use Caddy with external modules. We will be running caddy in docker for this.

We provide a ready docker image `bitcart/caddy`. Docker is installed as part of Bitcart install.

### Configure Bitcart for reverse proxy

Follow the docker deployment guide, but first time, instead of `./setup.sh`, run:

```bash
./setup.sh --preset proxied
```

If you run behind [Cloudflare](/proxying-bitcart/cloudflare), use the following preset:

```bash
./setup.sh --preset cloudflare-proxied
```

### Configure caddy

Prepare caddy directory:

```bash
mkdir -p /opt/caddy
cd /opt/caddy
```

Create `docker-compose.yml`:

```yaml
services:
  caddy:
    image: bitcart/caddy:2
    container_name: caddy
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - ./conf:/etc/caddy
      - ./site:/srv
      - caddy_data:/data
      - caddy_config:/config
    extra_hosts:
      - "host.docker.internal:host-gateway"

volumes:
  caddy_data:
  caddy_config:
```

Run `docker compose up -d` to start caddy. Ensure you have stopped all other reverse proxies. Caddy can be easily configured to replace other reverse proxies and host all your sites.

Two folders will be created: `site` will be the `/srv` directory inside Caddy container, where you can put your static sites, and `conf` is `/etc/caddy` inside our container, where `Caddyfile` is located.

Now, create the following `Caddyfile` in `conf` directory:

```caddyfile
(logging) {
	log {
		output stdout
		format console
	}
}

{
	log {
		output stderr
		format console
	}

	servers :443 {
		listener_wrappers {
			layer4 {
				@bitcart tls sni bitcart.yourdomain.tld
				route @bitcart {
					proxy host.docker.internal:10083 {
						proxy_protocol v2
					}
				}
			}
			tls
		}
		# if running behind cloudflare, uncomment this
		# trusted_proxies cloudflare
    # client_ip_headers X-Forwarded-For
	}
}

http://bitcart.yourdomain.tld {
	@wellknown path /.well-known/*
	handle @wellknown {
		reverse_proxy host.docker.internal:10080
	}

	handle {
		redir https://{host}{uri} permanent
	}
}

otherservice.yourdomain.tld {
	import logging
	tls
	respond "your ip: {client_ip}"
}
```

{% hint style="danger" %}
Ensure to replace `bitcart.yourdomain.tld` with your actual domain running bitcart
{% endhint %}

{% hint style="warning" %}
Caddy will not start if you don't configure at least one domain besides the Bitcart one. Make sure to set up your other website(s) in the Caddyfile (like the `otherservice.yourdomain.tld` block in the example above) before starting Caddy.
{% endhint %}

Restart caddy:

```bash
docker compose down && docker compose up -d
```

Now everything should work automatically!

Your client ip will be properly determined, and bitcart nginx will handle SSL certificates instead of Caddy. For other apps hosted on the same server, use `host.docker.internal` to access localhost of your machine.

You can also add caddy to custom docker networks to access other services by container name, for example:

```yml
services:
  caddy:
    ...
    networks:
      - default
      - forgejo_default

...

networks:
  forgejo_default:
    external: true
```


# Your first invoice

This document describes the whole process you should do after [Deploying](/deployment) to get your first invoice in your store!

## Registering on an instance

The first step in setting up your Bitcart instance is creating a user account. The **first created account** on a newly-deployed Bitcart instance is automatically - **admin**.

Server admins have the same access to features as the regular users, but they are also provided with some [server management tools](/guides/server-management-settings) like server upgrade or server policies management.

To register, visit your Bitcart URL and fill in the account registration form. Input your password, password confirmation, e-mail and click "Register". You will automatically be logged in.

![Register account form](/files/-MPeVzvhF9sS5Sn6Iob1)

## Creating a wallet

Inside Bitcart, you can setup and manage an unlimited number of wallets. Each wallet has its own xpub (BTC-based blockchains) or a single wallet address (ETH-based blockchains), and currency. One wallet holds one currency.

Bitcart is a non-custodial software, which means that all the funds received to your store, will end up directly into your connected wallet.

**You need to have your blockchain wallets created beforehand to specify their details in Bitcart! (more on this below)**

### Creating a wallet for Bitcoin-based blockchains (BTC)

*Note: A* [*private key*](https://en.bitcoin.it/wiki/Private_key) *(xprv) is **never** required for receiving money on-chain to a Bitcart wallet. The software needs a public key (xpubkey) which is a watch-only wallet token. The xpubkey allows Bitcart to generate a new address each time a new invoice is generated. It enables users to observe the wallet balance and transactions without having to share their private key.*

To manage the funds received to your Bitcart wallet, you can use an external wallet.

We recommend that you use the wallet which:

1. Allows connection to a full node
2. Allows custom gap limit

The most recommended wallet for use with Bitcart is the [Electrum wallet](/your-first-invoice/electrumwallet), as Bitcart uses electrum internally, which makes it perfectly integrated.

### Creating a wallet for ETH-based blockchains (ETH, BSC)

You can use any ETH-compatible wallets (e.g. MetaMask, or Mycellium) to create your ETH or BSC wallets. Copy-paste your wallet address from wallet software to Bitcart into "Wallet / Xpub" input.

### Creating a wallet in Bitcart UI

To setup wallets, make sure you're logged in into your account, and go to > **Wallets** by clicking Details button on the card. Click on the **create wallet** button and fill in the wallet name, currency(optional, default btc) and xpub (or wallet address for ETH-based blockchains).

![](/files/-MPeIUu1Aoh8871M0j9y)

## **Create a store**

Inside Bitcart, you can create and manage an unlimited number of stores. Each store has its own wallet or wallets (it allows multicurrency checkout), can create products, invoices or be connected with external e-commerce software through one of the integrations.

To create a store, make sure you're logged in into your account, and go to > **Stores** page by clicking on **Details** in it's card. Click on the **New Store** button. Enter the store name, and select this store's wallets.

![Create a store](/files/-MPeXaiW3BWyFXm40fHk)

### Customizing your Bitcart Store Settings <a href="#customizing-your-bitcart-store-settings" id="customizing-your-bitcart-store-settings"></a>

You can always edit your store by clicking the edit icon.

To configure email servers, click on email icon in actions column.

For more information, check [Stores FAQ](/support-and-community/faq/stores-faq).

## Creating your invoice

You can create your invoice in a variety of different ways

### Via admin panel UI

![You can customize a lot of settings during invoice creation](/files/ACWlHzxqvEwyKhGbd60e)

This method is one of the most obvious. You can create invoices from the panel, manage your orders and send links to checkout pages to your customers. Click on the show button in the payment methods column to view the checkout page.

![That's how you can access real checkout page](/files/PUwbj4DX6Tf27PNfte41)

![Bitcart checkout page](/files/-MReeR0bTO8JUU6oFWSx)

### Via store POS

Bitcart provides a ready to use store POS. You can manage your products and invoices right from the admin panel! Check out the [POS guide](/guides/store-pos)

![POS is your lightweight and ready store](/files/MdijqDYZWmm2XIOBtLod)

![Nice POS-like checkout](/files/9CtzivhlcE6Fj2Zl81Wo)

![Fields customers can enter on checkout](/files/5nVGdaNpJof1NjEmElVU)

![Store POS checkout page](/files/jxg6kh5Or0oU7HM63cBB)

### Via our e-commerce integrations

Depending on the CMS you're using, you can easily connect Bitcart to your online store. Currently, Bitcart offers following integrations :

* [Shopify](/integrations/shopify)
* [​WooCommerce​​](/integrations/woocommerce)
* [WHMCS](/integrations/whmcs)
* [FOSSBilling](/integrations/fossbilling)
* [Odoo](/integrations/odoo)
* [​Custom integration​](/integrations/custom-integration)

## Join our community!

That's it, your first invoice was created with ease!

If you have questions, try searching our FAQ Section or join the [Bitcart Community](/support-and-community/community) and share questions and ideas for improvement.

If you are a developer take a look at the [Local Development guide](/development/developing-locally) and help us with any [open issues](https://github.com/bitcart/bitcart/issues) on Github. If you would like to contribute to Bitcart in other ways, check out the [Contribution Guide](/support-and-community/contribute) for ideas.


# Electrum wallet

This document explains how to connect a desktop [Electrum Wallet](https://electrum.org/) to Bitcart.

Electrum wallet is recommended, as Bitcart is tightly integrated with it, providing the best user experience and speed.

1. Register an account in your Bitcart instance
2. ​[Download](https://electrum.org/#download) and install Electrum Wallet

## Electrum Wallet Setup <a href="#electrum-wallet-setup" id="electrum-wallet-setup"></a>

After the installation, open Electrum Wallet by clicking on the icon on your desktop.

### Quick Setup <a href="#quick-setup" id="quick-setup"></a>

1. Create a new Electrum Wallet
2. In Electrum, Wallet > Information - copy the **Master Public Key**.
3. In Bitcart, Wallets > Create wallet > Paste the Extended Public Key in xpub field

## Step by Step <a href="#step-by-step" id="step-by-step"></a>

The following setup guides you through setting up an entirely new Bech32 (SegWit) Wallet in Electrum. If you already have a wallet skip to the Extended Public Key copying.

Firstly, give your wallet a name, for example, `Bitcart Wallet` and click `Next`.

![Enter your new wallet's name](/files/-M-Pt-Kj-mLVWxaPUfz5)

Choose `Standard wallet` and proceed by clicking the `Next`button.

![Select wallet type](/files/-M-Q06ORl_L7vRnaF-sP)

Since we're creating a brand-new wallet,choose `Create a new seed` and `Next`

![Create a new seed](/files/-M-Q0c3wwnrE033RD9F9)

From the multiple choice menu, select `SegWit` and `Next`

![Select Segwit](/files/-M-Q0mHL8__-M3XdUxva)

**IMPORTANT NOTE:** If you're a merchant, instead of SegWit (Bech32), it's recommended to use SegWit wrapped (P2SH) format. [This guide](https://www.youtube.com/watch?v=-1DBJWwA2Cw) explains how to create P2SH wallet in Electrum that's more suited for merchants, due to compatibility with legacy wallets customers use.

**IMPORTANT NOTE 2:** Write down your recovery words in the order you see them on the screen. Write them down a piece of paper and store it somewhere secure. Take your time and triple check each word. Do not store your seed in a digital format (photograph, text document). Whoever has the access to your seed can access your funds. Confirm that the seed has been properly backed up by re-entering it in the same order. Once the seed is validated, proceed to the next step.

![Backup your seed!](/files/-M-Q19iO9s227v7PSR8A)

It's highly recommended that you encrypt your wallet. Select a password that you can easily remember and mark make sure `Encrypt Wallet File` is marked. Proceed by clicking `Next`.

![Encrypt your wallet!](/files/-M-Q1oOpml9xqyGcM1-D)

When the wallet loads (it may take few moments), in the top menu, click on the `Wallet` and then`Information` .

![See wallet information](/files/-M-Q2P8ale9cTcn0MTIs)

Select and **copy** the `Master Public Key`. This is the **public** key from which Bitcart will derive addresses.

![Copy the Master Public Key](/files/-M-Q6ex4aogEbpxSTazX)

Return to your Bitcart. Click on the `Details` button in the `Wallets` card and click on the `New Wallet` button. Enter your wallet name and Paste the Master Public Key from electrum to xpub field. Click `Save`.

![Add new wallet](/files/-MPeX9IsWHKlBtiP8aer)

### Configuring the Gap Limit in Electrum <a href="#configuring-the-gap-limit-in-electrum" id="configuring-the-gap-limit-in-electrum"></a>

In the top menu, click on the `View` and then`Show Console` .

![Show console](/files/-M-Q86AjQ1EdU93VvoRw)

Enter following commands in Electrum console and press `enter` on your keyboard.

```
 wallet.change_gap_limit(100) 
```

If you are running a version older than Electrum 4, also enter the following command and press `enter`

```
wallet.storage.write()
```

![Enter the commands here](/files/-M-Q8tP7LPOwmh_5S6iO)

Restart your Electrum and verify that the newly set gap limit is correct by entering in the console:

```
wallet.gap_limit
```

There's no good answer to how much you should set the gap limit to. Most merchants set 100-200. If you're a big merchants with high transaction volume, you can try with even higher gap limit.

For more details about the Gap Limit, check the FAQ.

Electrum and Bitcart are now connected. Any payments received to your Bitcart will be visible in Electrum, where you can further spend them.


# ETH payments plugin

ETH payments plugin allows to improve payments UX of ETH-based coins (currently ETH, TRX, BNB, POL) and all their tokens (USDT, USDC and more on those chains) by disabling address prompt and accepting payments from exchanges. This allows you to boost your sales massively as this plugin allows you to accept all currencies Bitcart supports + ETH-based coins with the best UX possible while still remaining **non-custodial**, with **minimum security risks** and by **saving on network fees** (using **just 1 transfer** instead of the usual 2 to withdraw tokens from your pool addresses)

## Users guide

### Purchase

First of all, to buy the plugin, ensure you are running Bitcart v0.9.0.0 or later

Open your plugins page and click on purchase button:

<figure><img src="/files/VjrwPvkp8NPZMsbGPmXl" alt=""><figcaption><p>Purchase plugin flow</p></figcaption></figure>

After that you will be able to choose monthly or yearly billing.

{% hint style="warning" %}
Ensure the email address you enter is not a disposable one, it will be used to send you license key, billing invoices and plugin updates
{% endhint %}

{% hint style="info" %}
If you have any issues with payment, please contact us at <hello@bitcart.ai> or in official community groups.
{% endhint %}

### Activation

After successful payment you will receive an email with your license key and plugin download URL. There is no need to download the plugin unless you have some custom setup, everything can be done in admin panel UI.

<figure><img src="/files/atRGWO73C4wpvngxnKLL" alt=""><figcaption><p>Plugin activation email</p></figcaption></figure>

Next, head to plugins page and enter your license key there

<figure><img src="/files/z48MpA5F2q0Rwbe9ORm1" alt=""><figcaption><p>Add license key dialog</p></figcaption></figure>

<figure><img src="/files/VM1XNZ9GliMcPTFtcLjy" alt=""><figcaption><p>Plugin install button</p></figcaption></figure>

After you have added the key, purchase button will turn into install button. Just press it to install the plugin.

<figure><img src="/files/We7bftcxTMcK6qm6Wxdc" alt=""><figcaption><p>Reload plugins button</p></figcaption></figure>

Don't forget to click the reload plugins button to apply changes. It will take a few minutes for plugin to build as it applies updates to the admin panel which take more time to build.

### Wallets setup

After that, address prompt should be removed automatically. If after 10+ minutes it doesn't disappear, please contact us

#### Native coins

For native coins (like ETH, TRX and others), when payment is received to the wallet pool address, it is sent to your primary address automatically, because when we have a native coin on address, we can just send all of it minus network fees to the primary address.

#### Tokens

For tokens (like USDT, USDC and others), it can't send payment to your primary address without paying network fees. As for tokens it is needed to pay network fee in native coin, and wallet pool addresses don't have it, that's why it is needed.

That's where the plugin shines in, it allows us to cut network fees by using only 1 transfer instead of 2.

First, you need to create a fresh wallet, which will be used only for paying network fees. Ensure to not deposit too much to it, as this is the only private key that is inserted into the system and has higher risks of being compromised if e.g. the server gets hacked. But your primary wallet is always safe as you just enter it's address.

Let's create a fresh wallet in let's say, trust wallet:

<figure><img src="/files/RINQs6hIudj8As6kD1lM" alt="" width="148"><figcaption><p>Trust wallet create dialog</p></figcaption></figure>

<figure><img src="/files/aH3toaNSs2dfScgBPopK" alt="" width="148"><figcaption><p>Seed phrase wallet</p></figcaption></figure>

<figure><img src="/files/1wAi2kke4JmrAeKeY2Tc" alt="" width="148"><figcaption><p>Main wallet page</p></figcaption></figure>

<figure><img src="/files/S9Fxqvh3TSsxz8nl6phw" alt="" width="148"><figcaption><p>Export seed page</p></figcaption></figure>

You can use the seed directly, or if you really want to have a private key specifically, you can do it for example with Bitcart cli by running this on server:

```bash
 ./bitcart-cli.sh -c coin --diskless -w "seed here" getprivatekeys
```

{% hint style="info" %}
Note the space before the command. This is used to not save the seed into bash history.

Coin is eth, trx etc.
{% endhint %}

<figure><img src="/files/bBax7B2Xx0mKQulY7GeA" alt=""><figcaption><p>Configuring wallet</p></figcaption></figure>

### Managing wallet pool

The plugin adds a new page for wallets: address pool management. It is accessible by clicking an icon near any of your eth-based wallets.

<figure><img src="/files/tspSnpKw0R17NoaiOfiM" alt=""><figcaption><p>Opening address pool page</p></figcaption></figure>

<figure><img src="/files/2Afn58XSGxgtOWxubFWt" alt=""><figcaption><p>Address pool management page</p></figcaption></figure>

This page is another key feature of the plugin: you can view all your addresses used in invoices from one page

Status has the following values:

* Free - ready to be re-used in upcoming invoices
* In invoice - attached to a currently active invoice. It is freed when invoice gets either expired or paid
* Pending payout - invoice with this address was paid, so it will be attempted to do a withdrawal. Actual withdrawal will happen only if it meets min withdrawal and network fee criteria, and for tokens, if fee private key was set and has enough balance
* In payout - payout is being performed right now

Init Status indicates whether the fee wallet is authorized to send payments to your primary wallet from this pool's address in just 1 transfer:

* Uninitialized - address is new and hasn't been set up yet. Ensure you have your fee private key set and that fee wallet has balance
* Initializing - address is in the process of being initialized
* Initialized - address is fully set up and ready to use. For non-token payments, this is always the case as no fee wallet is required.

If needed, you can trigger withdrawal manually if you click on withdraw button. Also batch withdraw and delete actions are available.

### Troubleshooting

If you want to view debug logs of the plugin, click on profile icon->server management->policies

And enable the debug checkbox near eth\_payments plugin:

<figure><img src="/files/gWUHfioHShQW1bNcO9xZ" alt=""><figcaption><p>Enabling debug mode</p></figcaption></figure>

You will then be able to view debug logs in server logs of your instance.

## FAQ

### What makes the plugin worth it? How is it any different from all already existing solutions on the market?

The main difference is that, existing solutions are custodial and they store all information about your payments, customers and anything else they can get. Also custodial means money gets sent from your customers to their intermediate addresses, and only then sent to you. Which means if they want they can lock you out of your funds.

Bitcart on the other hand, operates by accepting payments **directly to your wallet**. Private key is never required either. For plugin to work it does require generating unique deposit addresses, but private keys for all addresses in your wallet pool are stored **in your local database** and not stored anywhere else. Which means, even in worst case you always have private keys to withdraw the funds, and the plugin automatically sends payments from pool addresses to your primary address without any manual intervention.

Also as everything is hosted on your own server, you have full control over your data: order information is never shared with anyone, **everything is stored on your server only**.

And another key feature is: when sending tokens from pool addresses where no native coin is present, the usual flow is 2 transfers: first, estimate the approximate amount of network fee needed for a token transfer, and send that to the pool address, wait for some time when it gets confirmed, and then send the tokens.

The plugin on the other hand requires only 1 transfer: if pool address is initialized, the fee wallet is able to send tokens from pool address to your primary address utilizing it's native coins, **avoiding the second transfer**. This makes it way more **reliable** and allows to **save on network fees**.

### Which information does the plugin collect?

The plugin collects minimal information possible for accurate billing and abuse control:

* Monthly volume done by using the plugin only (this is sent as a dictionary where key is invoice currency, value is total). No order information leaves your server, plugin uses database query to collect aggregate numbers only and send to license server for accurate billing
* Plugin version
* Machine ip + machine id. Used for abuse control, by default only 1 server can use the plugin at the same time. If you switch servers, wait 6 hours for the old plugin to stop sending license checks, then a new server can be switched to automatically. If you need it faster contact us and we'll reset machine binding

### What is monthly volume and how is it determined?

The plugin collects aggregate sum of paid invoices where payment method used is created by the plugin (so ETH-based coins only, coins untouched by the plugin are not billed) over the last month

The information is sent to license server where it uses it's exchange rates to combine it into one final USD amount.

### If I pick yearly billing, am I still billed for volume?

Yes, but only if you exceed the monthly 2000$ unbilled volume. The plugin price itself will be billed once a year, and each month where you do exceed the thresold, you will be billed only on the excess amount.

### How do you charge fees? Is it still non-custodial?

Yes, we don't intervene in your invoice generation or payouts at all. Everything is processed by your server. At the end of the month (your billing period), you will receive an email with bitcart invoice to pay. It is calculated based on your billing cycle and monthly volume stat. You have 7 days to pay the invoice until the plugin gets deactivated. If it does, you have to contact us and we can re-issue the invoice


# Bitcart Plugins Development

### Creating a New Plugin

Bitcart plugins are modular components that can extend the functionality of your Bitcart instance. A plugin can consist of one or more of the following components:

* **Backend**: Server-side logic, database models, and API endpoints
* **Admin**: Extensions to the admin panel UI
* **Store**: Customizations for the store frontend
* **Docker**: Docker compose deploy customizations

To create a new plugin, use the [Bitcart CLI](https://github.com/bitcart/bitcart-cli):

```bash
bitcart-cli plugin init .
```

This will guide you through creating a new plugin by asking for:

* Plugin name
* Author
* Description
* Component types to include

To install plugin to develop alongside bitcart, you can use `bitcart-cli plugin install .`

It is recommended to pass `--dev` flag to install plugin in development mode. It uses symlinks to link the plugin to the bitcart source code, so when you make changes to the plugin, they are reflected immediately.

It asks for paths where you cloned bitcart, bitcart-admin and other repositories. You can pass `--save` flag to save paths to config, so that it is never asked again.

After you are done developing and want to remove it from codebase:

```bash
bitcart-cli plugin uninstall your_plugin_name
```

### Backend Plugin Development

#### Plugin Structure

A backend plugin must have a `plugin.py` file which as a `Plugin` class that implements the `BasePlugin` class from `api.plugins`. The basic structure is:

```python
from api.plugins import BasePlugin

class Plugin(BasePlugin):
    name = "your_plugin_name"
    
    def setup_app(self, app):
        # Configure FastAPI app, add routes
        pass
        
    async def startup(self):
        # Initialize plugin, register hooks
        pass
        
    async def shutdown(self):
        # Cleanup resources
        pass
        
    async def worker_setup(self):
        # Setup background tasks
        pass
```

#### Database Models

To add custom database tables:

1. Create a `models.py` file in your plugin directory
2. Define SQLAlchemy models
3. Manage migrations using alembic:

```bash
python scripts/pluginmigrate.py your_plugin_name revision --autogenerate -m "Migration message"
```

```bash
python scripts/pluginmigrate.py your_plugin_name upgrade head
```

Basically same commands as alembic, but you provide your plugin name.

This will create a new migration in the `versions/` directory. Migrations are automatically applied when the plugin is loaded.

#### Hooks and Filters

Bitcart provides two extension mechanisms:

1. **Hooks**: Execute actions at specific points
2. **Filters**: Modify data as it flows through the system

```python
from api.plugins import register_hook, register_filter

# Register a hook
register_hook("event_name", async_handler_function)

# Register a filter
register_filter("filter_name", async_filter_function)
```

To find hooks and filters, you can search the codebase for `apply_filters` and `run_hook`.

For example, `db_modify_wallet` would be called right after wallet is saved in db.

So you can use it like this:

```python
from api.plugins import register_hook

class Plugin(BasePlugin):
    ...

    async def startup(self):
        register_hook("db_modify_wallet", self.my_hander)

    async def my_handler(self, wallet):
        print(wallet)
```

And in filters first argument you receive is the value which you can return unmodified or modify. Other arguments are optional data

Example:

```python
from api.plugins import register_filter, SKIP_PAYMENT_METHOD

class Plugin(BasePlugin):
    ...

    async def startup(self):
        register_filter("create_payment_method", self.create_payment_method)

    async def create_payment_method(self, method, wallet, coin, amount, invoice, product, store, lightning):
        # multiple options:
        # return SKIP_PAYMENT_METHOD # skip this method, e.g. if error occured
        # return method # fallback to bitcart default code, e.g. call add_request on the daemon
        return {
          "payment_address": "youraddress",
          "payment_url": "willbeinsideqrcode",
          "lookup_field": "for your reference",
          "metadata": {"somekey": "somevalue"},
        }
```

#### Plugin Settings

To add custom settings for your plugin:

```python
from pydantic import BaseModel
from api.plugins import register_settings

class PluginSettings(BaseModel):
    setting1: str = ""
    setting2: bool = False

register_settings("your_plugin_name", PluginSettings)
```

Settings are automatically available in the admin panel and can be accessed via:

```python
from api.plugins import get_plugin_settings

settings = await get_plugin_settings("your_plugin_name")
```

#### Dependencies

If you need to add backend dependencies, create a requirements.txt file in your plugin directory, it will be installed automatically.

```
your_plugin_name/
├── requirements.txt
```

### Frontend Plugin Development

#### Admin Panel Extensions

Admin plugins can extend the UI using the our plugin system based on [vuems](https://github.com/ergonode/vuems). The basic structure is in e.g. `admin/your_plugin_name`:

```
your_plugin_name/
├── config/
│ ├── extends.js # Component and dictionary registration
│ ├── index.js # Plugin configuration
│ └── routes.js # Custom routes
├── pages/ # Custom pages
└── components/ # Custom components
└── package.json # dependencies
```

#### Extending the UI

1. Register custom components in `extends.js`:

```javascript
export default {
  extendComponents: {
    // Add components to specific UI slots
    'dashboard-widgets': [MyWidget],
    'invoice-details': [CustomInvoiceInfo]
  },
  dictionaries: {
    // Add custom data dictionaries
    'my-data': { /* ... */ }
  }
}
```

2. Add custom routes in `routes.js`:

```javascript
import CustomPage from '../pages/CustomPage'

export default [
  {
    name: 'custom-page',
    path: '/custom',
    component: CustomPage
  }
]
```

3. Add dependencies to `package.json`

#### Store Extensions

Store plugins follow a similar structure to admin plugins but are specifically for the store frontend. They can:

* Add custom pages
* Extend existing components
* Add new payment methods
* Customize the checkout process

### Plugin Packaging

To package your plugin:

```bash
bitcart-cli plugin package .
```

This creates a `.bitcart` file that can be installed on any Bitcart instance.

### Best Practices

1. Use descriptive names for hooks and filters
2. Document your plugin's requirements and dependencies
3. Handle errors gracefully
4. Clean up resources in the shutdown method
5. Follow the existing code style
6. Test your plugin thoroughly before distribution

### Plugin Lifecycle

1. Plugin discovery and loading
2. Database migrations
3. Plugin initialization (startup)
4. Hook/filter registration
5. Settings registration
6. UI component registration (if applicable)
7. Background worker setup (if needed)
8. Shutdown cleanup on server stop


# Default nodes/your own node

You may have a question: which servers does Bitcart use by default? It depends on the coin!

## Default nodes

### BTC-based coins

If using BTC-based coins where we use Electrum or it's forks, it is connected to a network of electrumx/fulcrum servers, which are indexers of the blockchain. It connects to multiple servers, verifying with SPV (Simple Payment Verification) that the results acquired are valid. It is reliable enough and can handle any load. This is the same list you would see if you downloaded Electrum wallet yourself and connected to the network

### Other coins (ETH-based, TRX, XMR)

For other coins we don't have something like electrum existing, and we also don't have a network of blockchain indexers.

That's why for those coins Bitcart daemons require at least 1 full node RPC to be configured. In coins like ETH free RPCs are widespread and have good rate limits. So the defaults will always use some free  RPCs which should be good enough for Bitcart to run

{% hint style="info" %}
New since Bitcart v0.9.0.0: it is now possible to use multiple nodes, so if one RPC fails, it will use the next one in the list and so on, allowing to specify as many servers as possible, archieving unbreakable stability
{% endhint %}

{% @github-files/github-code-block %}

Defaults are usually set in docker compose components.

**NOTE**: Since Bitcart v0.9.0.0, seed server feature was launched. Servers are no longer hardcoded in yml files, so in case some RPC breaks, users won't need to update each of their instances, we can edit it in the seed server and the daemon will update links at maximum in 1 hour. This is the default behaviour inside docker deployments now. To disable it, set `COIN_SERVER` to some specific server, just as it was done before.

If you want to view the current list of servers used for each specific coin, you can call seed server directly, for example:

{% embed url="<https://seed-server.bitcart.ai/eth>" %}

## Your own node

### BTC-based coins

In order to run your own node, first you need to run the actual full node, like [bitcoin core](https://github.com/bitcoin/bitcoin).

Then you need to run an indexer compatible with Electrum protocol, so either [ElectrumX](https://github.com/spesmilo/electrumx) or [Fulcrum](https://github.com/cculianu/Fulcrum) (recommended).

Then you can point Bitcart to it via `COIN_SERVER`. You can force to connect to only your server and not others via `COIN_ONESERVER`.

### Other coins (ETH-based, TRX, XMR)

Just run the full node of the coin you selected, and then set `COIN_SERVER`  to the RPC url of your node.


# One domain mode

One domain mode is an opt-out feature, enabled by default, which simplifies the configuration of domains.One domain mode allows running all Bitcart services under one domain.

If you are deploying a new instance from the Bitcart Configurator, it is the default mode enabled.

But this was not always the case, one domain mode was added in Bitcart version 0.3.0.0.

You only need to set one environment variable to run Bitcart: `BITCART_HOST`.

All the services will run either under the root domain, or the suburls on that domain.

One domain mode is enabled, when the following settings are unset:

* `BITCART_ADMIN_HOST`
* `BITCART_ADMIN_URL`
* `BITCART_STORE_HOST`
* `BITCART_STORE_URL`

Depending on the configuration, the service that will run on the root domain is selected in the following order (if available): store, admin, api.

So, if all 3 components are enabled, and `BITCART_HOST` is `bitcart.mydomain.com`, then:

* The store will run at `https://bitcart.mydomain.com`
* The admin will run at `https://bitcart.mydomain.com/admin`
* The Merchants API will run at `https://bitcart.mydomain.com/api`

Or, if only the Merchants API is enabled, then it will run right at `https://bitcart.mydomain.com`.

### Why is "one domain mode" there, and it is not the only possible configuration variable?

Because despite having the easy-to-use one-domain mode, we also support advanced use cases.

For example, you may need to run Merchants API on one server, and admin and store on another one.

It is completely possible.

On one server (with api), you would run:

```bash
sudo su -
git clone https://github.com/bitcart/bitcart-docker
cd bitcart-docker
export BITCART_INSTALL=backend
export BITCART_HOST=api.yourdomain.tld
./setup.sh
```

And on another one (with admin and store), you would run:

```bash
sudo su -
git clone https://github.com/bitcart/bitcart-docker
cd bitcart-docker
export BITCART_INSTALL=frontend
export BITCART_ADMIN_HOST=admin.yourdomain.tld
export BITCART_STORE_HOST=store.yourdomain.tld
export BITCART_ADMIN_API_URL=https://api.yourdomain.tld
export BITCART_STORE_API_URL=https://api.yourdomain.tld
./setup.sh
```


# Backups

Bitcart supports backing up it's data on one server and restoring it on another.

It is available via both UI and terminal.

## Backups management from admin panel

To enter backups management page, go to profile->server management->backups

![Backups management page](/files/-MjyLBWSsOWwLE6rkzUt)

![Backups management page](/files/-MjyLFXhZsHcv2Eh3VwX)

From there you can start a backup right away, it uses settings from this page to do it.

### Backup settings

You can select which backup provider to use. All of them, except for local, require setting environment variables as you can see on the screen above.

#### Local

Local provider just saves the backup on your current machine.

It is saved to `/var/lib/docker/volumes/backup_datadir/_data/`

Backups are named `YYYYMMDD-HHMMSS-backup.tar.gz`

#### SCP

SCP provider copies the file from your server to `SCP_TARGET` and deletes backup locally

Required settings:

* SCP\_TARGET: for example `username@ip/where/to/put/backups`

#### S3

S3 provider sends your file to amazon S3 and then deletes it locally

Required settings:

* S3\_BUCKET: in which bucket to save the backup
* S3\_PATH: where exactly in the bucket to save the backup

### Scheduling backups

It is possible schedule backups to run automatically.

![Configure backup frequency](/files/-Mjy7XFch6RabagZdUp-)

For backups to work, your settings must be valid (otherwise it will just fail every time), and you need to tick the scheduled backups checkbox. The timer will be saved even after server restarts.

{% hint style="warning" %}
Settings are saved automatically, and if you had existing schedule configured and change frequency/turn off and then on again backups, the timer will be reset
{% endhint %}

{% hint style="info" %}
We assume that daily is exactly every day, weekly is every 7 days, monthly is every 30 days
{% endhint %}

### Restoring backups

![Restore backup](/files/-MjyLQtxVyKr8uT065Ts)

Restoring backups is as easy as just uploading backup file to your instance!

## Backups management from terminal

### Creating backups

Backup settings are configured via environment variables

If you need to run backup for scp provider, you would run:

```
BACKUP_PROVIDER=scp SCP_TARGET=user@ip:backups ./backup.sh
```

### Restoring backups

Assuming that your file is named `backup.tar.gz`, just run:

```
./restore.sh backup.tar.gz
```


# Lightning Network

{% hint style="danger" %}
Lightning network support is experimental, as the lightning network itself.

Process with caution, and don't put large amounts in your lightning channels.

Before enabling lightning, please read all the warnings.
{% endhint %}

Lightning network in Bitcart is supported via Electrum's lightning network implementation

It has some limitations, please read the most up-to-date version at your admin panel.

![Lightning network warnings](/files/-MPtbdQO5Mow-cslJbPM)

To enable lightning network, for each coin, run:

```bash
export COIN_LIGHTNING=true
```

Where `COIN` is coin symbol (i.e. `BTC`, `LTC`)

Note that it will utilize a bit more server resources, but not by much.

When enabled, you will be able to enable lightning on the wallets page.

Currently lightning is only supported in the native segwit wallets.

When opening a non-supported wallet (or if lightning is disabled in the daemon), you will see the following page:

![Lightning unsupported page](/files/-MPtf2rnTeGtHbYAvlKS)

If lightning is supported, by clicking on the lightning icon and accepting all warnings, it will be enabled for the wallet.

If lightning is enabled for a wallet, then, along with the regular coin payment method, a lightning one will be created.

As your Bitcart daemons are standalone lightning nodes, you will need to open lightning channels from scratch. You can use the lightning management page for this

## Lightning management

![Open lightning management page](/files/-MPtg743zP0QsEM4gLxP)

![Lightning management page](/files/-MPtfeDLhSWTXJiqxT5H)

From the lightning management page, you will see your lightning balance, your node id, list of open channels, and you will be able to close, force-close or open new channels.

You can also pay lightning invoices from that page via your node.

## Lightning checkout

From the checkout page, customers will be able to scan either the lightning invoice, or your node id.

That way they can open a channel with you

![Lightning checkout scan tab](/files/-MPtgWh0bR2LvJ93QUED)

![Lightning network copy tab](/files/-MPtg_fbPgIvgdbO4_Kf)


# Transaction speed

![Transaction speed](/files/-MRaTc8541mGGpChnkhC)

What does transaction speed mean?

First of all, transaction speed applies only to on-chain invoices. All lightning invoices are instantly marked as complete.

To understand why transaction speed setting is needed, you need to understand the invoice statuses in Bitcart:

When invoice has just been created, it has `pending` status.

If no payment has been sent within the invoice time frame (expiration time), invoice is marked `expired`. Expired invoices no longer listen for incoming payments, but you may manually mark it complete.

If a payment has been sent within the invoice time frame (expiration time), invoice status is set to `paid`.

With `paid` status, customer is redirected to the redirect URL, and checkout page shows paid. But all the notifications, emails and custom scripts aren't executed yet.

When payment has been confirmed (has >= 1 confirmations), invoice status is set to `confirmed`.

When payment's number of confirmations is >= transaction speed, invoice status is set to `complete`, and all the postorder actions are executed (like notifications).

So, transaction speed controls how fast you want your invoice to be complete. Default value of 0 provides the fastest checkout, but it is not always good for your use case, it might be not safe.

Value of 1 means waiting for one confirmation, which is enough in most cases.

You can set transaction speed to any value between 0 and 6 (there is no point in waiting past 6 confirmations).


# Fiat currencies support

Bitcart supports automatic conversion from fiat currencies to payment method's currency upon invoice creation.

It is done via cached pre-fetched exchange rates, got from configured provider.

The default fiat currency used for prices is USD.

The default exchange rate provider is CoinGecko, as it provides a big list of fiat currencies to select from, as well as the historical rates, plus it is free of charge and has generous limits.

Bitcart's default exchange rate is the same as Electrum's one.

All the exchange rate providers available in Electrum are also available in Bitcart.

## Fiat currencies in the admin panel

To change fiat currency used in your store, change it's default currency field:

![Store default currency](/files/-MPk6ZcSIwF4DO2IKskq)

Store default currency is the one displayed in the [Store POS](/guides/store-pos), and the one used by default for invoice creation.

You can override invoice default currency when creating it:

![Invoice currency](/files/-MPk6rWM079oP024K6CP)

## Changing the exchange rate provider

Currently, you can configure the exchange rate provider only via an environment variable passed to the daemon, and it is not accessible in the docker deployment. We want to improve that in the future.

Set the `COIN_FIAT_EXCHANGE` variable to the name of exchange you want to use, like so:

```bash
BTC_FIAT_EXCHANGE=CoinDesk python3 daemons/btc.py
```


# Templates

Templates in Bitcart are powered by the Jinja2 templating engine. It means that you have the full flexibility of the templating engine.

There are currently 3 different templates you able to customize in Bitcart: `notification`, `product` and `shop`. Plus you are able to create custom-named templates for use with our future scripting language.

Check the example templates [here](/examples/templates)

For each of the objects, you are able to select a custom template.

The templates for an object are selected as per [template selection rules](/bitcart-basics/walkthrough#template-selection-rules)

![Store default templates](/files/-MPkCIVUytA6C78Lf7wV)

## HTML templates

In some places of Bitcart, it is possible to render templates as html files instead of plain text.

For example, in emails sent to customer on successful checkout, you could use default templates (or customized a bit) which are plain text, or instead, you could enable html template rendering and send your customers a beautiful email.

Currently html template rendering is available only in [store emails sent to customer](/bitcart-basics/walkthrough#store-checkout-settings)

**Note**: if you enable html template rendering, default templates or any plain text templates will now render incorrectly, without new lines. So ensure to check that template rendering templates match the templates themselves.

If you have a decimal field that needs to be formatted properly using currency data (e.g. price), you can use the `format_decimal` filter to format it properly, passing key of field on the model.

```jinja
{{ invoice | format_decimal("price") }}
```

You can check html templates examples [here](/examples/templates).

## Available templates

### Notification

Notification template is used when building the message to be sent via all configured [notification providers](/bitcart-basics/walkthrough#notification-providers) to the merchant notifying of successful order (to start shipping, for example).

The are two variables passed:

* `store`, containing the store this notification belongs to
* `invoice`, containing the invoice that has been paid

You can use those two variables to build whatever message that fits the best for you.

The default template is the following:

```
New order from {{ invoice.buyer_email }} for {{ invoice | format_decimal("price") }} {{ invoice.currency }}!
```

An up-to-date version can always be found at this [link](https://github.com/bitcart/bitcart/blob/master/api/templates/notification.j2)

### Shop

Shop template is used when building the base message for a successful payment associated with a store. It may optionally include paid invoice products' templates.

The are two variables passed:

* `store` is the store the invoice is associated with
* `products` is a list of already rendered individual product's templates

You can use this template to provide some design for the order confirmation message sent to the buyer.

The default template is the following:

```
Welcome to our shop!
Thank you so much for your order!
Your summary is below:
{% for product in products %}
{{product}}
{% endfor %}

If you've got any questions, email us at {{store.email}}.
Best wishes, your {{store.name}}.
```

An up-to-date version can always be found at this [link](https://github.com/bitcart/bitcart/blob/master/api/templates/shop.j2)

### Product

Product template is used when building the message for each individual product. Normally it is included as part of the main store message sent to the customer upon successful payment.

There are 3 variables passed:

* `store` is the store the product is associated with
* `product` is the current product being processed
* `quantity` is the quantity the customer has selected to buy

Note that, you can configure different templates for each product, or use the same template for all products.

The default template is the following:

```
Thanks for buying {{product.name}} x {{quantity|int}}!
{% if product.download_url %}
Your download link: {{product.download_url}}
{% else %}
It'll ship shortly!
{% endif %}
```

An up-to-date version can always be found at this [link](https://github.com/bitcart/bitcart/blob/master/api/templates/product.j2)


# Themes

It is possible to customize the look and feel of Bitcart UI by overriding some CSS variables.

Currently it is supported for store POS only.

A list of possible css variables: <https://github.com/bitcart/bitcart-store/blob/master/assets/bulma-generated/generated-bulma-vars.sass>

Guide to customizing the theme:

1. Create a css file changing some theme variables

{% code title="theme.css" %}

```css
:root {
  --brand-color: #162d50;
  --primary: var(--brand-color) !important;
  --success: var(--brand-color) !important;
  --link: var(--brand-color) !important;
}
```

{% endcode %}

2. Upload theme file to file storage of your instance

<figure><img src="/files/iSyVPi6J5Kpd7zsYjbwP" alt=""><figcaption></figcaption></figure>

3. Copy download URL and use it in store theme URL setting in stores page

<figure><img src="/files/G5oiRWEuDgP4K8XYeAyR" alt=""><figcaption></figcaption></figure>

4. Enjoy updated theme colors!

<figure><img src="/files/2jBKDFPSdv9v6i8dsgN8" alt=""><figcaption><p>New colors applied</p></figcaption></figure>


# Telegram notifications

Bitcart makes use of the [Apprise](https://github.com/caronc/apprise) API to deliver notifications to Telegram.

![](/files/5pcEUcphYZq09RwORNVr)

To integrate Telegram with Bitcart, you by-and-large follow the procedure outlined in the [Setup Guide](https://appriseit.com/services/telegram). However, there are few recommendations and gotchas.

## Multiple recipients

You can deliver the notifications to multiple telegram users by providing multiple chat ids, separated by spaces.

## Markdown templates

Due to a [bug](https://github.com/caronc/apprise/issues/1178#issuecomment-2269802339), if you select `markdown` as the template format, you should leave the `markdown version` field blank, or set it to `1`. Contrary to the apprise documentation, specifying `2` or `v2` here will result in messages not being delivered.

Telegram only supports a subset of markdown. It pays to read the [Telegram docs](https://core.telegram.org/api/entities#allowed-entities) to see what's supported.

If there are any mistakes, the message gets rendered as text (at best), or (usually) apprise rejects the notification with a "bad parse" error. This is true of user input too. If promo code is `FREE_STUFF`, the underscore is interpreted as the start of italics and will break all the formatting.

For this reason, you *must* escape all input in your templates, especially user-provided input like email addresses, notes, and shipping addresses. Bitcart provides a ready filter for markdown v1, e.g. `{{ invoice.buyer_email|tg_escape }}`.

But if you're doing anything but the simplest of reports, it's *highly* recommended to just switch HTML templates over Markdown.

## HTML templates

For more complicated notifications, prefer HTML templates. Again, Telegram has limited support for HTML, but the Jinja templating engine has better support for escaping HTML entities.

See [the HTML notification template example](/examples/templates#html-notification-template) for a working example.


# Store POS

Your store POS is a ready-to-use store, which you can use in online or physical stores.

It is enabled by default in the full docker deployment.

It is enabled in the `frontend` or `all` installation groups (see `BITCART_INSTALL` setting at [Docker deployment](/deployment/docker#configuration))

The store POS displays the information for the store configured by server admin. It can display one store at once. It is controlled from [server management settings](/guides/server-management-settings#id-of-the-store-to-enable-on-pos)

The price slider will automatically adjust to the maximum price of the products in the store. The currency for all products in the store is determined by the [default currency](/bitcart-basics/walkthrough#stores) of selected store

Categories are built from all of the selected product's categories, plus the `all` category to show all products

The Only Sale setting shows only products that have an active [discount](/bitcart-basics/walkthrough#discounts) connected to them.

The Contact Us text shows the store's email. It is configured in the email settings of the store

At the header, store name is displayed.

Tor icon is added if [Tor support ](/guides/tor)is enabled.

Before checkout, customer will be able to enter their email, and optionally, a promocode.

![Store POS main page](/files/-MPtZoCL08H7sPRA25Y7)

![Store POS product details](/files/-MPtZrmD5L3zUlX3DK_e)

![Cart](/files/-MPtZvsvqfeKY77vi4aB)

![Checkout details](/files/-MPt_0f8EOQ272TAxD2y)

![Checkout page](/files/-MPt_3ovJJYSMHJIDyzY)


# Server management settings

Bitcart has a few server management settings available.

They are accessible only by the superusers.

Superusers are the users of the instance with admin privilege.

The first registered user is the super user, then they can add new ones from server management settings.

The server management settings don't leak the privacy of other users, super users can't view other users stores or wallets.

If you are the super user, you will be able to enter the settings by clicking on the profile icon->server management settings

![Enter server management settings](/files/-MPpRii4fT1lGvVD5hd5)

## User management

![User management page](/files/-MPsigNABCPOA560Tj2o)

From the user management page, you will be able to view all users registered on your instance, create new users or delete existing ones. Also, you can change a user's password and optionally make someone a superuser.

![Create new user](/files/-MPsjPBpf8EcA_wt1p9l)

![Superuser is displayed this way](/files/-MPsjgQ3aNOgGZrNb3kz)

Note that, when editing user, it is not possible to view their existing password.

It is because, Bitcart is secure and doesn't store plain text passwords. Only hashed passwords are stored.

![Edit user](/files/-MPsjuDQInz0F1qu9yuy)

You can click on the switch to make someone a superuser or make someone a regular user instead.

**IMPORTANT:** do **NOT** switch your own user, it will make you loose the superuser rights. The only way to recover will be via the database. It will be disallowed in the future versions of admin panel to avoid confusion.

## Server logs

![Server logs page](/files/-MPskU5_Iphx0zABaLdi)

From the server logs page, you will be able to check server logs.

The logs are ordered by their date-the latest log displayed the first.

Logs are aggregated by day.

It is possible to delete logs (except for the today's log, as it is used by the instance).

You can also download the log, to send it for troubleshooting purposes for example.

## Maintenance commands

![Maintenance commands page](/files/-MPsl5iFaTpD3ggBRTtk)

From the maintenance commands page, you can execute common actions-upgrade your server or clean up it.

### Update the server

It will start the update process. During it your instance might be unavailable, and the page won't automatically reload after the update.

The update process will upgrade the cloned `bitcart-docker` repository, upgrade the docker-compose generator image, generate new configuration file from saved settings (from `.env` file), upgrade all the used docker images, recreate the modified containers and clean up the now unused images

### Restart the server

It will start the restart process. During restart your instance might be unavailable. Use restart feature to fix some possible bugs, if you met some.

### Cleanup the server

The cleanup process will do two actions: [cleanup unused images](#cleanup-unused-images) and [cleanup logs](#cleanup-logs).

See more below

### Cleanup unused images

This process does the same as after upgrade-cleans up all unused bitcart images from previous upgrades

### Cleanup logs

This command deletes all logs except for the currently used one.

## Policies

![Policies](/files/-MPsqRhEznSz8V0uMdOo)

The policies allow you to control some server-wide important settings.

### Disable user registration

If you check this on, users will not be able to register on your instance. Register link will be removed from the login page, register page will not be accessible and the API will discard any register attempts. Turn it off to enable registration back.

![No link for registration on login page](/files/-MPtTEa_KRilnzPhghzS)

### Discourage search engines from indexing this site

By enabling this setting, your instance will tell the search engines to stop indexing your site. It should disappear from search results. Note that it might not work with some search engines.

### Check for updates once a day

When enabled, your instance will check github for new Bitcart releases, and display a notification in the admin panel that a new update is available.

![New update available message](/files/-MPtWm8CkI5L6-VCI9Ej)

### Allow access to configurator for unauthorized users

By default it is on. When enabled, users can access `https://admin.yourbitcart.ai/configurator`, and deploy their instance from there via the [Configurator](/deployment/configurator).

## Store policies

![](/files/-MVGpaH24JBG-I-rsNVT)

On the store policies page, you are able to configure some settings related to all the stores on the server or the [Store POS](/guides/store-pos)

### ID of the store to enable on POS

Enter the id of the store that will be displayed by the store POS. It will display this store's products and use this store's settings.

### Require email on POS checkout

By default it is on. When enabled, users must enter their email on store POS to continue to checkout, otherwise they can continue without email.

## Daemons management

![Daemons management page](/files/-MPtY0BLt8aWsn3YY8sS)

This page is purely informational. You will see a list of connected daemons and some of their settings.


# Tor

Bitcart supports Tor as an additional service. When enabling it, all the services (admin, merchants API, store) will also be available as Tor hidden services.

When enabling Tor hidden services, nginx will automatically be configured to serve requests from .onion domains. But if using a custom reverse proxy or just not the built-in nginx, ensure to set up server records for each hidden service. More information below.

## Warning

Enabling Tor doesn't give absolute security. And if used incorrectly, it may even lead to bigger problems. It is very hard to make every component of Bitcart and it's dependencies use the onion network only, and we don't guarantee that.

When enabling tor, the components of Bitcart will be communicating via the onion URLs if accessed from the onion network too, and all the daemons will be connecting to the onion servers more often than regular ones.

So, Tor support is mostly to be used to access Bitcart components when running it at home, or behind a complex firewall.

## Enabling Tor support

To enable tor support, you will need to add additional component to the deployment.

Re-configure your instance like so:

```bash
export BITCART_ADDITIONAL_COMPONENTS=tor
./setup.sh
```

Note, if you have already had some additional components enabled before, separate them with comma.

## Checking if Tor support works

When enabled, the admin panel and store will have an onion icon.

Also, if opening any of the components in Tor browser, you will be automatically suggested to open the hidden service version of your site.

But if you need to get the hostname of some service without using the clearnet version of the site, you can run this command:

```bash
cat /var/lib/docker/volumes/compose_tor_servicesdir/_data/service/hostname
```

Where `compose` is the name of your deployment, by default it is indeed `compose`, and `service` is the service name you want to check, where spaces are replaced with `-` symbol.

Examples:

```bash
cat /var/lib/docker/volumes/compose_tor_servicesdir/_data/Bitcart-Merchants-API/hostname # for Merchants API
cat /var/lib/docker/volumes/compose_tor_servicesdir/_data/Bitcart-Admin-Panel/hostname # for admin panel
cat /var/lib/docker/volumes/compose_tor_servicesdir/_data/Bitcart-Store/hostname # for store
```

![Admin panel's tor icon](/files/-MPorNl_oAyJeSbWlu33)

![Store's tor icon](/files/-MPorqFjboB-OJral-nq)

From the admin panel, you will also be able to check all the hidden services links for all services. Click on the services button to the right of the dashboard button.

![Hidden services list](/files/-MPos0WyB_7rPT8XUzmb)

![Onion service available in the Tor browser](/files/-MPoshVfLX3W9pWx1qaM)


# Multiple deployments on one server

Bitcart supports multiple deployments on one server.

**Note** that it is an advanced topic, and use it only if you know what you are doing.

When setting up multiple deployments on the same server, the services that export their ports to outside can't be run twice.

It means that you will need to set up nginx reverse proxy manually, and disable nginx in each of the deployments.

When disabling nginx, all the services will expose ports to outside, to be able to use them from nginx installed globally on the server.

To run multiple deployments, pass the deployment name via `--name` argument. The default deployment name is `compose`.

```bash
./setup.sh --name demo
./setup.sh --name test
./setup.sh --name production
```

Note that you should use different clones of the `bitcart-docker` for each deployment, as the setup script creates `.env` file with all your settings, and `.deploy` file with configuration name, and if you run different deployments in the same directory the configuration files will be overwritten.

Do it like so:

```bash
git clone https://github.com/bitcart/bitcart-docker
cd bitcart-docker
# export settings
./setup.sh
cd ..
git clone https://github.com/bitcart/bitcart-docker bitcart-demo
cd bitcart-demo
# export settings
./setup.sh --name demo
cd ..
# do the same process for each deployment
```

To disable reverse proxy, run:

```bash
export BITCART_REVERSEPROXY=none
```

Note that when running multiple deployments, the Merchants API, the admin and the store will have the same ports. You need to change that.

To change ports, run `export BITCART_SERVICE_PORT=port`

Where `SERVICE` is the component name, and `port` is the port, for example:

```bash
export BITCART_BACKEND_PORT=8001 # set merchants API port to 8001
export BITCART_ADMIN_PORT=4001 # admin panel at port 4001
export BITCART_STORE_PORT=3001 # store at port 3001
```

You should configure nginx yourself. The only recommendation is: it is easy to configure nginx via certbot.

Instead of disabling nginx, you may also leave it running at different ports, see this [guide](/support-and-community/faq/deployment-faq#can-i-use-an-existing-nginx-server-as-a-reverse-proxy-with-ssl-termination).

Run:

```bash
sudo certbot --nginx -d your.domain.tld
```

And it will create nginx config records for you, and then edit the `location /` config, by using `proxy_pass http://localhost:port`

**Note:** when using multiple deployments on one server, environment variables may be loaded incorrectly on login (due to same environment variable names).

To ensure that you have loaded the correct environment for your deployment, in your deployment directory, run:

```bash
./load_env.sh
```

It will load the correct settings.


# Healthcheck

Bitcart Merchants API automatically performs health checks of your daemons every 5 minutes (on startup, it checks after 2 minutes). This is the same type of check that happens when you open admin panel and see daemons unsynchronized alert.

If some daemons are not running somehow, or are unsynchronized, it will log this in the server logs. If you want, you can connect notification providers and get real-time notifications to your favourite messenger when something fails. For that, go to server policies page and set Health check store ID to the store which has the needed notification providers connected, and it will then work automatically. If you need to customize the default template, edit the syncinfo template in global templates, see [Templates](/guides/templates).

<figure><img src="/files/iTpzIQJc7mdtke6Ft2aP" alt="" width="375"><figcaption><p>Example notification when daemons are down</p></figcaption></figure>

### Troubleshooting not running daemon

Please check your daemon logs and ensure they are running properly.

View daemon logs with `docker logs compose-coin-1`, e.g. `docker logs compose-bitcoin-1` for Bitcoin.

Debug logs are off by default, you can turn them on by running:

```
export COIN_DEBUG=true
./setup.sh
```

e.g. `export BTC_DEBUG=true` for Bitcoin.


# Shopify

The following document guides you through **setting up Bitcart with** [**Shopify**](https://www.shopify.com)**.**

### Prerequisites: <a href="#prerequisites" id="prerequisites"></a>

* Shopify account
* Bitcart - [self-hosted](/deployment) or run by a [third-party host](/deployment/thirdpartyhosting) v0.6.7.0 or later.
* [Created Bitcart store](/your-first-invoice#create-a-store) with [wallet set up](/your-first-invoice#creating-a-wallet)

{% embed url="<https://youtu.be/c09Av7SgaQM>" %}

### Setting up Bitcart with Shopify

1. In Shopify, go to Apps > and at the bottom of the page click on the `Develop apps for your store`.
2. If prompted, click on `Allow custom app development`
3. `Create an app` and name it
4. On the app page, in `Overview` tab, click on the `Configure Admin API scopes`
5. In the filter admin access scopes type in `Orders`
6. In `Orders` enable `read_orders` and `write_orders` and then click `Save`
7. Click on the `Install App` in the top right corner and when pop-up window appears click `Install`
8. Reveal `Admin API access token` and `copy` it.
9. In your Bitcart, go to Stores page and click on shopify integration icon.
10. Enter your shop name
11. In secret key field paste the `Admin API access token`
12. In the api key field paste the `API key` from Shopify.
13. In Shopify's `Store Settings > Checkout > Order status page > Additional Scripts` paste the script provided by Bitcart in Shopify Integration dialog when you click the copy script button (including the opening and closing tag `</script>`.
14. In Shopify's `Store Settings > Payments > Manual payment methods` add `manual payment method` then click `create custom payment method`
15. In `Custom payment method name` fill in `Bitcart`, optionally you can fill in other fields, but it's not required. Please see the message below about naming of a custom payment method
16. Hit `Activate` and you've set up Shopify and Bitcart successfully.

{% hint style="info" %}
Custom Payment method name **must** contain at least one of the following words: `bitcoin`, `bitcart`, `bitcart` or `btc` to work.
{% endhint %}


# WooCommerce

To install the woocommerce plugin for Bitcart, please follow the steps below

{% embed url="<https://youtu.be/04tWVvePBdI>" %}

## Install the Bitcart Woocommerce plugin

### Via Wordpress

1. WordPress > Plugins > Add New.
2. In Search, type "Bitcart for WooCommerce"
3. Install and activate.

![Install the plugin via wordpress plugin repository](/files/-MPiyrrpHnrvl3nA8Znm)

### From Github

Download the latest plugin [release](https://github.com/bitcart/bitcart-woocommerce/archive/master.zip), upload it in the .zip format to your wordpress instance and active it.

## Deploy Bitcart

Refer to our [deployment guide](/deployment)

## Configure the plugin

Go to your store dashboard. WooCommerce > Settings > Payments. Click Bitcart.

1. Enter your Bitcart URL (URL of the Merchants API, like <https://api.bitcart.ai>)
2. Enter your Bitcart Admin Panel URL (for example, <https://admin.bitcart.ai>)
3. Change the store id used if needed
4. Save changes

## Important note

Bitcart will only be visible on the WooCommerce checkout page if you are using the Classic Checkout. This is no longer the default option, so Bitcart will not appear as a payment method unless you activate it. For instructions on how to enable the Classic Checkout, please visit: [WooCommerce.com - Reverting to the classic Cart and Checkout](https://woocommerce.com/document/woocommerce-store-editing/customizing-cart-and-checkout/#reverting-to-the-classic-cart-and-checkout)

## Test the checkout

If you have successfully configured your plugin, you will be able to checkout via cryptocurrency.

![](/files/-MPj-roMfI55hY_ZZp2U)

That's it!


# WHMCS

WHMCS integration provides an easy way to use Bitcart as a payment gateway in your whmcs instance

{% embed url="<https://youtu.be/lUNSbC8NzgQ>" %}

## Requirements

This plugin requires the following:

* WHMCS 7.x
* Running Bitcart instance: [deployment guide](/deployment)

## Installation

1. Open <https://github.com/bitcart/whmcs-plugin/releases/latest> and download the zip archive with the plugin
2. Copy the archive on your server
3. Extract the archive to your whmcs root, so that in your whmcs root, in modules/gateways there is a file named `bitcartcheckout.php`
4. At whmcs panel, go to setup > payments > payment gateways
5. On the next screen, click on the **All Payment Gateways** tab and click on **Bitcart Checkout** to enable the plugin. The next step will be to configure it.

## Plugin Configuration

After you have enabled the Bitcart plugin, the configuration steps are:

1. Enter your admin panel URL (for example, <https://admin.bitcart.ai>) without slashes
2. Enter your merchants API URl (for example, <https://api.bitcart.ai>) without slashes

This plugin also includes an IPN (Instant Payment Notification) endpoint that will update your WHMCS invoice status.

* Initially the WHMCS invoice will be in a **Unpaid** status when it is initially created.
* After the invoice is paid by the user, it will change to a **Payment Pending** status.
* When Bitcart finalizes the transaction, it will change to a **Paid** status, and your order will be safe to ship, allow access to downloadable products, etc.


# FOSSBilling

Integrate Bitcart into your self-hosted FOSSBilling instance easily!

{% embed url="<https://www.youtube.com/watch?v=t8YFOhTngQo>" %}

### Integration Requirements

This version requires the following:

* FOSSBilling instance
* Running Bitcart instance: [deployment guide](https://docs.bitcart.ai/deployment)

### Installing the Plugin

1. From your FOSSBilling panel, go to configuration > payment gateways -> New payment gateway
2. Upload Bitcart.php to the directory suggested by your deployment. [Download it](https://raw.githubusercontent.com/bitcart/bitcart-fossbilling/master/Bitcart/Bitcart.php) from this repository
3. Enable it by clicking on the button near Bitcart, fill in all settings and save.

### Plugin Configuration

After you have enabled the Bitcart plugin, the configuration steps are:

1. Enter your admin panel URL (for example, <https://admin.bitcart.ai>) without slashes. If deployed via configurator, you should use <https://bitcart.yourdomain.com/admin>
2. Enter your merchants API URL (for example, <https://api.bitcart.ai>) without slashes. If deployed via configurator, you should use <https://bitcart.yourdomain.com/api>
3. Enter your store ID (click on id field in Bitcart's admin panel to copy id)

Enjoy!


# Odoo

Integrate Bitcart into Odoo and bridge your company's management system with Bitcart as a way to process payments!

{% embed url="<https://youtu.be/9vorewcOBgE>" %}
Bitcart Odoo Plugin
{% endembed %}

### Integration Requirements <a href="#integration-requirements" id="integration-requirements"></a>

This version requires the following:

* Your Odoo instance
* Running Bitcart instance: [deployment guide](/deployment)

### Installing the Plugin <a href="#installing-the-plugin" id="installing-the-plugin"></a>

1. Add `payment_bitcart` directory to your addons directory (You can take [the latest release](https://github.com/bitcart/bitcart-odoo/releases/latest), unzip it and get `payment_bitcart` from there)
2. From your Odoo apps page, activate "Bitcart Payments" app
3. Configure the plugin (see details below)

### Plugin Configuration <a href="#plugin-configuration" id="plugin-configuration"></a>

After you have enabled the Bitcart plugin, the configuration steps are:

1. Enter your admin panel URL (for example, [https://admin.bitcart.ai](https://admin.bitcart.ai/)) without slashes. If deployed via configurator, you should use <https://bitcart.yourdomain.com/admin>
2. Enter your merchants API URL (for example, [https://api.bitcart.ai](https://api.bitcart.ai/)) without slashes. If deployed via configurator, you should use <https://bitcart.yourdomain.com/api>
3. Enter your store ID (click on id field in Bitcart's admin panel to copy id)

Enjoy!


# Custom Integration

Bitcart provides a variety of ways to integrate into your application.

## Bitcart SDK

Do you need something completely custom, like [atomic tip bot](/examples/atomic-tip-bot)?

Then you can use our [SDK](https://sdk.bitcart.ai)

It is a python library simplifying the usage of our core daemons (refer to [Architecture](/development/architecture) page for more information). If you are coding in python, you have the best development experience ever, as SDK supports everything daemon supports.

If coding in another language, you can either create a similar library for your language, or use the daemon directly.

The daemon follows the JSON-RPC 2.0 specification, with two extensions:

* Arguments may be passed either by position, or by name, or by position AND by name (in that case, args are a list, the last element of which is a dictionary containing by-name arguments)
* Xpub, if needed, is passed as part of the by-name argument

## Bitcart Merchants API

The Merchants API is used to simplify the usage of multiple daemons at once and suits the best for the case when you need to receive payments.

To create an invoice, just send a POST request to `/invoices`.

You can pass many arguments, but the only required ones are `price` and `store_id`.

Check out the [swagger documentation](https://api.bitcart.ai) for more information.

## Bitcart Admin Panel's checkout modal

To easily integrate a ready checkout page in your website, you may use a script that comes with your admin panel. You can create the invoice, and use that script to show a checkout modal on your page.

Example of usage to add the modal to your website:

1. Include the `bitcart.js` script in your html page

   ```markup
   <script src="https://admin.your.bitcart.url/modal/bitcart.js"></script>
   ```
2. Call the invoice API to generate an invoice (example code). This is sample backend code as it contains an auth token that should not be exposed in your front-end.

   ```javascript
   const axiosClient = axios.create({
     baseURL: BITCART_URL,
     timeout: 5000,
     responseType: "json",
     headers: {
       "Content-Type": "application/json",
       Authorization: BITCART_AUTH,
     },
   })

   const invoiceCreation = {
     price: 5,
     store_id: 1,
     order_id: "something",
     notification_url: "https://webhook.after.checkout.com/goeshere",
     redirect_url: "https://go.here.after.checkout.com",
   }

   const response = await axiosClient.post("/invoices", invoiceCreation)
   const invoiceId = response.data.id
   ```
3. Use the `invoiceId` to pop up the modal

   ```javascript
   window.bitcart.showInvoice(invoiceId)
   ```
4. You'll often want to do something like refresh the state of your page when the invoice is paid, or note some kind of state before the modal pops up. You can attach event listeners like this:

   ```javascript
   window.bitcart.onModalWillEnter(yourCallbackFunction)
   window.bitcart.onModalWillLeave(yourCallbackFunction)
   ```


# Atomic Tip Bot

Atomic Tip Bot is a bot which allows you to tip other users on telegram. It is a great example of Bitcart usage.

To get some funds to tip, user needs to deposit, which means generating an address and checking status of payment. We can use Bitcart [SDK](https://sdk.bitcart.ai) for that.

But also, users are able to withdraw their funds. It is also possible with the SDK, while this feature isn't available in many other payment processors, as Bitcart is not just a payment processor.

You can use `add_request` SDK method to create a new invoice.

```python
invoice = instances[currency].add_request(amount, description, expire=20160)
```

See the full [example](https://github.com/bitcart/bitcart-sdk/blob/804a6438b1187dff5da538feba16f65a25aae86f/examples/atomic_tipbot/bot.py#L320)

To process payments, we should register an event handler on our `APIManager` to handle the `new_payment` event, which is fired when a request was completed.

```python
async def payment_handler(instance, event, address, status, status_str):
    # bitcart: get invoice info, not necessary here
    # instance.get_request(address)
    if status_str == "Paid":
        # process
```

See the full [example](https://github.com/bitcart/bitcart-sdk/blob/804a6438b1187dff5da538feba16f65a25aae86f/examples/atomic_tipbot/bot.py#L383)

We can use `manager.start_websocket()` to start listening for new events.

If you are interested, read the full explanation at github [here](https://github.com/bitcart/bitcart-sdk/blob/master/examples/atomic_tipbot/README.md) or try the atomic tip bot yourself in [telegram](https://t.me/bitcart_atomic_tipbot)


# Templates

Templates are a powerful way to customize your store's checkout flow.

Please read the [templates guide](/guides/templates) first.

Here are some examples of ready templates.

As plain text templates are pretty simple, we show complex html examples. Ensure to enable [html template rendering](/guides/templates#html-templates).

**Note**: the templates contain a lot of boilerplate code to workaround different email clients rendering issues. All examples are self-contained and are ready to be used in production.

They were generated by this [email template generator](https://emailbuilder.top) and modified to be actual templates.

## Simple summary table

![](/files/-MQ8snyUFFHSoLkpEQrA)

This template is just a simple example of how to use html in your templates for better design. This example utilizes a table with some custom styles to display bought items.

{% embed url="<https://gist.github.com/MrNaif2018/29345d711181421753f1226366a39d36>" %}

`product.html` is the template that renders each individual product.

We use some of the available variables to show the product price, quantity selected, and final calculated price. `store.default_currency` can be used to get product's currency.

And in `shop.html` template (containing most of the design), we just use:

```
{% for product in products %}
{{product}}
{% endfor %}
```

To include all products' rendered templates.

And we also use `{{store.name}}` to display store name at the top.

## HTML notification template

The following HTML template produces a nice summary to the recipient whenever a new order is placed. It can be used anywhere notification templates are supported, but this example is especially suitable for Telegram or other instant-messaging notification services.

![Example Rendered template](/files/xcm0ZG5KFfzKXSQC3jCW)

### Tips and gotchas

* Ensure that you *escape* all input -- *especially* user-provided input like email addresses, notes, and shipping addresses. You do this by using the `escape` filter, e.g. `{{ invoice.buyer_email|escape }}`.
* To use this template as a notification template, you need to ensure that HTML rendering is supported by your notification provider. Telegram supports HTML formatting in messages, [for example](/guides/telegram-notifications).

```html
<b>New Order in {{ store.name|escape }}</b>

From {{ invoice.buyer_email|escape }}
Price: {{ invoice.currency }} {{ invoice.price|format_decimal("price") }}
Sent amount: {{ invoice.sent_amount|round(6) }} {{ invoice.paid_currency }}

{% if invoice.promocode %}
* Promo: {{ invoice.promocode|escape }}
{% endif %}
{% if invoice.discount %}
* Discount: {{ invoice.discount }}
{% endif %}
{% if invoice.shipping_address %}
* Deliver to: 
{{ invoice.shipping_address|escape }}
{% endif %}

<b>Notes:</b>
{{ invoice.notes|escape }}
{% if invoice.products %}

<b>Invoice</b>
<code>
| Item          | Price    | Qty |  Total |
|---------------|----------|-----|--------|
{% for product in invoice.products %}
{% set q = invoice.product_quantities[product.id] %}
{{ "| %-14s| %8.2f | %3.0f | %6.2f |"|format(product.name,product.price,q,product.price*q) }}
{% endfor %}
</code>
{% endif %}

<b>Actions</b>
* <a href="https://my_store.xyz/admin/i/{{ invoice.id }}">Open checkout screen</a>
* <a href="https://my_store.xyz/store/{{ store.id }}">Open Store</a>

<b>Details</b>
* Status: {{  invoice.status }}

```


# FAQ and common issues


# General FAQ


# Server Settings FAQ


# Deployment FAQ

This document covers the most common questions, errors, and issues you may encounter prior and during the installation of the software. For a detailed list of deployment methods and instructions for each, please see [Deployment page](/deployment).

## General Deployment FAQ

### How much does it cost to run Bitcart?

Bitcart is a 100% free and open-source software. We do not charge you anything. However, to run it, you should host it. You can run it as a self-hosted solution on your own local server, or use a cloud hosting provider, which is what a majority of users do.

Advanced users can run Bitcart on [their own hardware](/deployment/hardware).

If you do not wish to host your own server, you can use a free [Third-Party Host](/deployment/thirdpartyhosting).

Visit our [Deployment Page](/deployment) for more information on the various ways in which you can run Bitcart.

Hosting prices differ, but even a minimal server would suffice.

Hosting your own instance might make it a bit harder to start using Bitcart, but it is worth it, to get a [decentralized and secure solution](/bitcart-basics/bitcart-vs-others), with no third-party.

### What are the minimal requirements for running Bitcart?

The system requirements depend on the components you have chosen, but a typical full installation (with all essential components enabled, and btc daemon):

* 1 GB RAM (if using 1 GB RAM, adding a bit of swap space is recommended, due to the OS using some resources too)
* \~= 10 GB disk (way less actually, but just to be sure)
* Docker support by the OS (Ubuntu should work)

Note that, adding new coins typically don't increase the requirements a lot.

As of Bitcart 0.3.1.0 (March 8 2021), the system requirements to run Bitcart with all supported coins enabled are the same as the minimal requirements (maybe with a bit more swap space allocated).

### What is the easiest way to get started with Bitcart?

For a self-hosted solution, we recommend using our [Bitcart Configurator](/deployment/configurator) to easily deploy instances, without any technical skills required. You may also use the Lunanode Web deployment.

For just trying out, you can use our [demo](https://github.com/bitcartcc/bitcart-docs/blob/master/deployment/docker.md#live-demo) or a [third-party host](/deployment/thirdpartyhosting).

### How to choose the best deployment method for my use case?

Please refer to [Deployment](/deployment) page to view comparison of different deployment methods

### Can I run Bitcart on my own hardware?

Yes, the installation instructions almost don't differ. Refer to [Hardware deployment](/deployment/hardware) guide.

### After deployment, the admin panel is asking me to log in, but I don't know the credentials?

After deployment, you need to register on your instance. The first registered user is the server admin.

So click on the register link, and create your admin account.

### After deployment, accessing the admin panel or store gives "Nuxt 500 Server Error"

There are a few possible cases why this happens. But in almost all cases it is because it is having trouble connecting to the Merchants API.

#### 1. SSL certificates are not yet received

It might be possible that admin panel tries to access the merchants API via https\:// URL, but there is no SSL certificate available yet, which causes SSL error. Just wait a bit, and usually the problem is resolved. If not, try [restarting your server](/guides/server-management-settings#restart-the-server).

#### 2. Invalid Merchants API URL set

When using [one-domain mode](/guides/one-domain-mode), it should always work. But if you have accidentally set any of `BITCART_ADMIN_HOST`, `BITCART_ADMIN_URL`, `BITCART_STORE_HOST`, `BITCART_STORE_URL`, then one domain mode is disabled.

If that's not what you want, unset those variables:

```bash
unset BITCART_ADMIN_HOST
unset BITCART_STORE_HOST
unset BITCART_ADMIN_URL
unset BITCART_STORE_URL
./setup.sh
```

If that's what you want, then maybe the `BITCART_ADMIN_URL` or `BITCART_STORE_URL` is set to an incorrect value. Ensure that it starts with the protocol (http\:// or https\://), and that that URL is accessible.

#### 3. Merchant API not running or is having errors

If merchant API is not running, you can check it's logs for possible issues:

```bash
docker logs compose-backend-1
```

If some error is unexpected, please [report a bug](/support-and-community/troubleshooting-an-issue).

### How do I activate Tor support?

You need to run:

```bash
export BITCART_ADDITIONAL_COMPONENTS=$BITCART_ADDITIONAL_COMPONENTS,tor
./setup.sh
```

Refer to the [Tor guide](/guides/tor) for more details.

### Why is Tor useful for Bitcart? Does it mean that nobody knows who I am?

Tor for Bitcart is intended more as an improvement of the setup process, and allows for more flexibility for hosting on one's own device at home or in an office.

Having Tor activated would allow for simpler, plug-and-play usage of Bitcart, as it suppress the need for the following configuration steps:

* Opening multiple ports on the firewall
* Configuring the NAT for port redirection to your device on your local network
* Setting up a DNS entry to get a HTTPS certificate
* And any other difficulties you may face

While these steps are usually not a problem when Bitcart is hosted on a VPS, it can be difficult to solve for non-technical users on home or office networks.

Of course, you may use .local domain, but it will only be accessible from your local PC.

Tor just solves all these issues in one shot, all you have to do is plug your device on the local network. It is especially useful for POS application.

But if you're looking for perfect privacy and security, **activating Tor with your Bitcart just won't do it.**

Tor is a really tricky software to use for developers, as the slightest mistake can tear down the anonymity it provides. As Bitcart is evolving into a rather complex service and adding more and more plugins, even if we tried to route all this traffic through Tor, we couldn't guarantee that there would never be leaks of data in clear. There are many different requests we can't fully control or guarantee we control. When enabling Tor support, we do route the electrum and exchange rate requests through Tor, but that's the best we can do.

We think that the illusion of security is more dangerous that no security, or at least security we know is imperfect. So be aware that activating Tor doesn't prevent others to connect to your instance website, your bitcoin or lightning node in clear, **it doesn't make you anonymous at all.**

### **How do I get the .onion address of my instance without accessing it in the clearnet?**

See this [guide](https://docs.bitcart.ai/guides/tor#checking-if-tor-support-works).

### How do I deactivate some additional components, or modify some settings?

Bitcart is configured via environment variables.

You can always set some environment variable like so:

```bash
export VARIABLE_NAME=value
./setup.sh
```

Running `./setup.sh` will apply new settings.

For example, let's say I want to deactivate Tor:

```bash
# Login as root
sudo su -

# Go to the bitcart-docker directory (adjust for your deployment)
cd bitcart-docker

# Print the complete list of options that you are running (for the sake of the demonstration, let's say that besides Tor you have some custom component activated too)
echo $BITCART_ADDITIONAL_COMPONENTS
custom,tor

# Export the BITCART_ADDITIONAL_COMPONENTS variable without tor
export BITCART_ADDITIONAL_COMPONENTS="custom"

# Run setup.sh
./setup.sh

exit
```

Similarly if you are adding a new component, the export command would instead look like this:

```bash
# Enable Tor in addition to your existing environment variables
export BITCART_ADDITIONAL_COMPONENTS="$BITCART_ADDITIONAL_COMPONENTS,tor"
```

If you need to figure out which environment variable you need to modify, have a look at [this list](https://github.com/bitcartcc/bitcart-docs/blob/master/deployment/docker.md#configuration).

### How can I run Bitcart on testnet?

There is no such term as "testnet Bitcart". Bitcart is modular, and what you can do instead is, enable testnet on certain coins (daemons), but not on every one. So it is possible, let's say, to have bitcoin daemon running in mainnet, bitcoin cash in testnet, and litecoin in regtest.

To change the network of a coin, run:

```bash
export COIN_NETWORK=network
```

Replace `COIN` with the coin symbol (BTC, LTC, etc.), and `network` with the actual network name (mainnet,testnet,regtest).

So, for example, to enable testnet on bitcoin, run:

```bash
export BTC_NETWORK=testnet
./setup.sh
```

Note that Bitcart uses Bitcoin testnet v3.

### Can I start Bitcart only when I'm expecting a payment?

Theoretically it's possible, but it is not recommended.

Due to the nature of electrum networking, it is possible. But if you receive a payment when Bitcart is offline, it will only be processed when Bitcart is back up.

### Can I connect to the Bitcart core daemon from my deployment stack?

Yes, it is possible.

The recommended way though is, to use the Merchants API, which handles many edge cases.

But if you need to connect to your daemon directly, you can either:

#### Connect to the daemon as a part of deployment stack

You can add a custom component to the deployment stack via the `BITCART_ADDITIONAL_COMPONENTS` setting, and then, when running inside docker, you can always connect to daemons via their docker-compose name. For example, for bitcoin, the URL will be `http://bitcoin:5000`.

Check the list of URLs to connect to [here](https://github.com/bitcart/bitcart-docker/blob/master/dev-setup.sh#L10).

#### Connect to the daemon from outside

**Note**: it is not recommended, as it might be a security risk! The daemon default credentials can be viewed from the source code, so you should either change them, or make sure daemon can not be accessed by anyone but your services.

For that, run:

```
export COIN_EXPOSE=true
./setup.sh
```

The coin will now be accessible from the outside network.

### How can I renew my SSL certificate?

The SSL certificates are automatically refreshed. But it something is not working, you can always restart your instance by running:

```bash
./restart.sh
```

### Can I use an existing Nginx server as a reverse proxy with SSL termination?

Yes you can! Just make sure to use the proper configuration.

It is way easier to use built-in reverse proxy, but in cases when you are running [multiple deployments on one server](/guides/multiple-deployments-on-one-server), it is required.

Create an extra config file for your vhost in `/etc/nginx/sites-available/bitcart` and create a symlink for this file at `/etc/nginx/sites-enabled/bitcart`

The contents of this vhost file should look like this:

```
server {
	listen 80;

	# Put your domain name here
	server_name bitcart.domain.com;

	# Needed for Let's Encrypt verification
	location ~ /.well-known {
		allow all;
	}

	# Force HTTP to HTTPS
	location / {
		return 301 https://$http_host$request_uri;
	}
}

server {
	listen 443 ssl http2;

	ssl on;

	# SSL certificate by Let's Encrypt in this Nginx (not using Let's Encrypt that came with Bitcart Docker)
	ssl_certificate      /etc/letsencrypt/live/bitcart.domain.com/fullchain.pem;
	ssl_certificate_key  /etc/letsencrypt/live/bitcart.domain.com/privkey.pem;

	# Put your domain name here
	server_name bitcart.domain.com;

	# Route everything to the real Bitcart instance
	location / {
		# URL of Bitcart (i.e. a Docker installation with REVERSEPROXY_HTTP_PORT set to 10080)
		proxy_pass http://127.0.0.1:10080;

		proxy_set_header Host $http_host;
		proxy_set_header X-Forwarded-Proto $scheme;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

		# For websockets (used by checkout page)
		proxy_set_header Upgrade $http_upgrade;
	}

	# Needed for Let's Encrypt verification
	location ~ /.well-known {
		allow all;
	}
}
```

Also, put the following in your main Nginx config file at `/etc/nginx/nginx.conf`:

```
http {

	# ... # Existing stuff

	# Needed to allow very long URLs to allow Tor services support
	server_names_hash_bucket_size 128;
	proxy_buffer_size          128k;
	proxy_buffers              4 256k;
	proxy_busy_buffers_size    256k;
	client_header_buffer_size 500k;
	large_client_header_buffers 4 500k;
	http2_max_field_size       500k;
	http2_max_header_size      500k;

	# Needed websocket support (used by checkout page)
	map $http_upgrade $connection_upgrade {
    	default upgrade;
    	''      close;
	}

}
```

Now test your Nginx config with `nginx -t` and reload the config with `service nginx reload`.

Then, you need to make sure that Bitcart does not try to handle HTTPS on its side, you can do this by disabling it on your Bitcart instance.

```
export BITCART_REVERSEPROXY=nginx
export REVERSEPROXY_HTTP_PORT=10080
export REVERSEPROXY_HTTPS_PORT=10081
export BITCART_HTTPS_ENABLED=true # if your reverse proxy handles https
export BITCART_BEHIND_REVERSEPROXY=true
./setup.sh
```

Notice: If your Bitcart install has more than one domain (for example, when [one domain mode](/guides/one-domain-mode) is off) you will need to modify your config for each domain name. The example above only covers 1 domain name called `bitcart.domain.com`.

### Can I run Bitcart on my home computer?

Similar to the requirements for hosting a website, a web server is required for a Bitcart instance. While it is possible to run Bitcart locally on your PC, it would have to meet the minimal requirements and also run 24/7 if you don't want interruptions of service. You might also not want to expose your home IP address for the activity related to Bitcart payments. For all these reasons, while local hosting is suitable for testing, it's not a viable solution for production. A Virtual Private Server (VPS) is commonly used to address these problems.

But if you really need to do so, you have two options:

#### 1. Run via .local domain

If the `BITCART_HOST` variable ends with .local, then local mode will be activated. The setup script will automatically edit /etc/hosts. Note that, the reverse proxy must be set to `nginx`, and not default `nginx-https`.

The downside of this method is that it requires modifying `/etc/hosts`, and that the instance will only be accessible from your own PC.

#### 2. Via Tor

You can enable Tor support, and then your instance will be available from anywhere via `.onion` domain.

See the [Tor guide](/guides/tor) for more details.

## Manual Deployment FAQ

### How do I manually install Bitcart on Ubuntu 22.04?

See this [guide](/deployment/manual).

### How do I completely uninstall Bitcart from a linux environment (docker version)

1. Shutdown Bitcart with `./stop.sh` and cleanup the install with `./cleanup.sh`.
2. Delete all volumes in `/var/lib/docker/volumes/` with:`docker-compose -f compose/generated.yml down --v`
3. Remove other Bitcart system files with: `rm /etc/systemd/system/bitcart.service && rm /etc/profile.d/bitcart-env.sh`
4. Remove your Bitcart installation folder with `rm -r "$BITCART_BASE_DIRECTORY"`
5. Just to make sure, run `docker system prune` after a reboot to get rid of any other docker related artifacts.

### With the docker deployment, how to use a different volume for the data?

First, you need to make sure that bitcart and docker is not running

```bash
sudo su -
./stop.sh
systemctl stop docker
```

Now, you need to format your drive. If you have already done it, you can skip this step.

```bash
# Step 1: Unplug the drive
lsblk

# Step 2: Plug the drive
lsblk
```

The second `lsblk` should show the drive you just plugged in. (of TYPE `disk`) Make sure you don't make a mistake as the next command will erase all the data on this disk.

For the sake of this example, let's suppose it has the NAME `/dev/sdd`.

```bash
# Save the name in a variable
DEVICE_NAME="/dev/sdd"
# Set the partition name
PARTITION_NAME="/dev/sdd1"
```

Now we can partition the disk and format the partition:

```bash
echo "Partitioning the external drive $DEVICE_NAME..."
### DANGER ZONE ###
(
	echo o # Create a new empty DOS partition table
	echo n # Add a new partition
	echo p # Primary partition
	echo 1 # Partition number
	echo   # First sector (Accept default: 1)
	echo   # Last sector (Accept default: varies)
	echo w # Write changes
) | fdisk ${DEVICE_NAME}
partprobe ${DEVICE_NAME}
while ! lsblk $PARTITION_NAME &> /dev/null; do
	sleep 1
done
mkfs.ext4 -F "$PARTITION_NAME"
```

Then we need to mount the partition on the linux filesystem.

```bash
# Mounting the partition
MOUNT_DIR="/mnt/external"
mkdir "$MOUNT_DIR"
mount -o defaults,noatime "$PARTITION_NAME" "$MOUNT_DIR"

# Make sure the partition exists at the next reboot, we use UUID in case
# the partition name is different in the next reboot
if ! grep -qF "$MOUNT_DIR" /etc/fstab; then
	UUID="$(sudo blkid -s UUID -o value $PARTITION_NAME)"
	echo "UUID=$UUID $MOUNT_DIR ext4 defaults,noatime,nofail 0 2" >> /etc/fstab
fi
```

Then, we need to make sure that docker won't start before the mount.

```bash
MOUNT_UNIT="$(systemd-escape --path "$MOUNT_DIR").mount"
docker_service="/lib/systemd/system/docker.service"
if ! grep -qF "After=$MOUNT_UNIT" "$docker_service"; then
	sed -i "s/After=/After=$MOUNT_UNIT /g" "$docker_service"
fi
```

Now, imagine you want to transfer all the docker volume data to the new partition.

```bash
DOCKER_VOLUMES="/var/lib/docker/volumes"
# Copy all the data from our volume to the mount directory (this can take a while)
cp -a -r "$DOCKER_VOLUMES/." "$MOUNT_DIR"
# Make the folder a mountpoint
rm -rf "$DOCKER_VOLUMES"
mkdir -p "$DOCKER_VOLUMES"
mount --bind "$MOUNT_DIR" "$DOCKER_VOLUMES"
# Make sure the mountpoint is mounted after reboot
if ! grep -qF "$DOCKER_VOLUMES" /etc/fstab; then
	echo "$MOUNT_DIR $DOCKER_VOLUMES none bind,nobootwait 0 2" >> /etc/fstab
fi
```

Now restart docker and bitcart

```bash
systemctl start docker
./start.sh
```

**Note**: We use mount bind instead of symbolic link because docker would complain when running `docker volume rm`.

### I get 503 Service Temporarily Unavailable nginx

#### **Cause 1: Trying to access my Bitcart by IP address**

Your nginx config is set to route the HTTP request to a particular container based on the domain name of the request. For example, the official [deployment guide on pi 4](/deployment/raspberrypi) said to setup the source domain name to <http://raspberrypi.local/> yet getting automatic local domain raspberrypi.local does not always work. You are probably in this situation and trying to type the IP address of your Bitcart into the web-browser.

Since nginx gets the IP address in the request instead of raspberrypi.local it does not know where to route that request and returns:

```
503 Service Temporarily Unavailable
-----------------------------------
nginx
```

You can fix this by forcing nginx to route the HTTP request to Bitcart even if the request domain name is not recognized. Simply, re-run the setup script like this:

```
sudo su -

export REVERSEPROXY_DEFAULT_HOST="$BITCART_HOST" && ./setup.sh
```

Now putting local IP in the web-browser works.

#### **Cause 2: bitcart or letsencrypt-nginx-proxy is not running**

To check, run:

```
sudo  docker ps | less -S
```

Press "q" to quit out of less.

The output should contain:

* jrcs/letsencrypt-nginx-proxy-companion
* bitcart/bitcart

And the status should be "Up"

If the docker container is not running, then check the reason for crash like this:

```
 sudo docker logs compose-backend-1 --tail 20
```

Where `compose-backend-1` is the container name that is having issues.

**# Cause 4: Other**

There could be many causes for 5XX HTTP errors. Please create an [Issue](https://github.com/bitcart/bitcart/issues) and when cause becomes known add it here in the [Deployment FAQ](/support-and-community/faq/deployment-faq) doc.


# Terminology FAQ

## What is an xpub?

An xpub is a key, which can provide a read-only access to your wallet. It can only be used to watch transactions in your wallet, but not to send them on your behalf. In general, using xpub in some software is safer than using your seed or xprv, but it can leak your privacy if you share your xpub publicly (watching your wallet).


# Stores FAQ

## What is underpaid percentage?

Underpaid percentage is a store checkout setting, which can be in range from 0 to 99, indicating that the payment may be that percent less than expected, and it will still be accepted as paid. For example, if customer sends from an exchange wallet and the fees are deducted from the sent amount, the payment will still be accepted if you set underpaid percentage to a small non-zero value.

## What is the Use Dark Mode setting?

When enabling this store checkout setting, the checkout page will always be served in dark mode. Ensure to check that your logo is suitable for dark mode.

![Light (default) version of checkout](/files/-MReeR0bTO8JUU6oFWSx)

![Dark version of the checkout](/files/-MReeVj4hpGhGr2FBn7C)

## What is custom logo link?

To keep consistent branding, you can change the default Bitcart logo to your own logo. For that, it must be accessible via the URL provided. Note that, no matter what resolution the image is, it will be fit into maximum height of 40.

![Custom logo link](/files/-MRef0iJnyTLkQjJFkxc)

![Maybe in the future (:](/files/-MRef45Vbkd3XCSUVzKH)

## Recommended fee

Show recommended fee setting enables showing recommended fee for all onchain (i.e. not lightning) payment methods.

To configure it, you need to set the recommended fee confirmation target blocks setting, which configures the fee displayed. If you set it to 2, it would mean it will show the recommended fee for the customer to pay for his payment to be confirmed in 2 blocks. Default value is 1.

![Recommended fee on checkout](/files/-MRf2djGVwHDSbAVB1SE)

## How do I change my payment method's name?

By default Bitcart uses currency symbol as method name, and if there are multiple wallets of the same currency connected it adds an index to it (BTC(1), BTC(2)).

In some cases you may want to have a custom label for your payment methods, for example to indicate if some payment method is for legacy payments, and another is for segwit payments.

To do that, just add a label to your wallet:

![Custom wallet label](/files/-Mg0H1NvlrybjlxeIwO7)

![It will be enabled automatically for new invoices](/files/-Mg0HCp-uw8XhXgVCYvG)

## How do I display a checkout hint for customers?

Any wallet (payment method) may have a hint which will be displayed on checkout page. First of all, the default Bitcart hints are displayed (recommended fee unless disabled, and about sending exact amounts in eth). Your custom hint will be displayed below.

![It may link to your own's checkout guide](/files/3FeRpEfUBBWNwbmqTlWo)

![And see it on the checkout page!](/files/ABA5EQOFH0nKfu9ildRq)

## How do I randomize wallets used/distribute funds across multiple wallets?

Usually when you have multiple wallets of same currency (currency+contract pair) connected, it would be displayed like `BTC (1)`, `BTC (2)` or with a custom label. But it is now possible to randomize wallet used. This is useful to either distribute funds across multiple wallets for even better privacy, or in case of ETH to improve UX of checkouts page. You will no longer see each method, but only one, selected randomly.

![Before: the user chooses which method to use](/files/mJV3uhmyf8lpsibIQaDa)

![Enable it in checkout settings](/files/Deen3GHVW8gXAVPnibGB)

![After: random wallet is chosen and only one method is displayed](/files/X2Cy57f4e5f84dwmSP8A)

## Why could anyone create an invoice without authorization? How to disallow that?

That's because, for store POS and custom integrations from different sites to work, it can't get an authorization token in a way which is not seen to the user. Currently all integrations work same way.

But it is possible to make authorization mandatory on a per-store basis in store settings:

<figure><img src="/files/8Lq1sHlkFOnSrl5DQCZ6" alt=""><figcaption></figcaption></figure>

Please note that, when disallowing anonymous invoice creation, all plugins and store POS will break. Use this only if you have a custom integration where you are able to create invoices server-side only for authorized users only (otherwise, it is working same way as Bitcart works, but with another unnecessary layer of complexity added)


# Altcoin FAQ


# Support

This project is open source, and is not a company. Instead we rely on a network of contributors and users to provide support.

## Free support

Problem? Don't worry, someone else has probably been through that before you.

* First have a look at our [user documentation](https://docs.bitcart.ai) and Frequently Asked Questions.
* If your issue is not referenced there, or you want to request a new feature, please open a [github issue](https://github.com/bitcart/bitcart/issues).
* If you have more general questions about Bitcart, the way it works and why you should use it, you're welcome on our [Telegram](https://t.me/bitcart)

Getting a proper support also depends on how you formulate your questions. Read our [troubleshooting guidelines](/support-and-community/troubleshooting-an-issue).

## Paid support

Do you have some complex project where you want to integrate Bitcart and not sure how to do it? Do you need to add some custom feature to Bitcart just for your project and you want professional help?

Some of our team members can assist you with paid support:

### MrNaif2018

The author of Bitcart, he knows everything about the project. Able to customize any part of the project in any way to provide support.

Skills: Python (experience in various backend frameworks), Vue (Nuxt.js, UI frameworks Bulma (Buefy) and Vuetify), Docker (and docker-compose, building various stacks and building docker-compose generators), Bash (custom scripts), Git and more

You can find him in Bitcart [Telegram](https://t.me/bitcart) or just in telegram at username @MrNaif\_bel.


# Troubleshooting an issue

Facing a problem is never fun. This document explains the most common workflow and steps you should take to **identify the issue** you're having more easily and hopefully solve it yourself or with community help.

Identifying the problem is crucial.

## 1. Replicating the issue

First and foremost, try to determine when the issue happens. Try to replicate the problem. Try to update and restart your server to verify you can reproduce your issue. If you think it will describe your issue better, take a screenshot.

### 1.1 Updating the server

Check your version of Bitcart. If it is much older than the [latest version](https://github.com/bitcart/bitcart/releases/latest), [updating your server](/guides/server-management-settings#update-the-server) may resolve the issue.

### 1.2 Restarting the server

Restarting your server is an easy way to solve many of the most common Bitcart issues. You may need to SSH into your server to restart it.

### 1.3 Restarting a service

Some issues you may only need to restart a particular service in your deployment. Such as restarting the lets encrypt container to renew the SSL certificate.

```
sudo su -
cd bitcart-docker
docker restart letsencrypt-nginx-proxy-companion
```

Use `docker ps` to find the name of a different service you would like to restart.

### 2. Looking through the logs

Logs can provide an essential piece of information. In the next few paragraphs, we will describe how to get the **log information for various parts of Bitcart**.

### 2.1 **Bitcart** Logs

You can easily access Bitcart logs from the front-end. If you are a server admin, go to **Server Management > Server logs** ([guide](/guides/server-management-settings#server-logs)) and open the logs file. If you don't know what a particular error in the logs means, make sure to mention it when troubleshooting.

If you would like more detailed logs and you're using a Docker deployment, you can view logs of specific Docker containers using the command line.

Use `docker ps` to get the name of container you need. Usually it is the [docker component ](https://github.com/bitcart/bitcart-docker/blob/master/generator/docker-components)name with [deployment name](/guides/multiple-deployments-on-one-server) prepended to it.

Run the commands below to print logs by container name. Replace the container name to view other container logs.

```
sudo su -
cd bitcart-docker
docker ps
docker logs --tail 100 compose-worker-1
```

## 3. Finding a solution yourself (Google, FAQ, GitHub issues)

Even though setups differ, the chances that someone else experienced the same issue as yours are pretty high. Take a few moments, Google around and see if you can solve it yourself.

### 3.1 Bitcart FAQ

We try to document the most common issues on the [Frequently Asked Questions page](/support-and-community/faq). Take a look there and see if your question is recorded.

### 3.2 GitHub

When there's an advanced technical issue, users usually open an issue on GitHub. Take a look at the Bitcart GitHub repository and browse [search the closed issues](https://github.com/bitcart/bitcart/issues?q=is%3Aissue+is%3Aclosed)

### 3.3 Telegram

Our Telegram group is great for similar issues, other users experienced before you. Search messages for your question

## 4. Asking for help

If you're unable to solve the problem yourself, do not worry. There's an amid community ready to help you.

The better you describe the problem, the higher are the chances of getting a timely fix. Be concise and provide as much relevant information as possible. Be sure to include the version you're using and describe your deployment setup. Try to explain what you're trying to do and what's the issue. If you can provide the logs. If you think it's relevant, feel free to include a screenshot.

Here's a good example of how to ask a question.

> I'm having a problem with XYZ. I can replicate the problem. My Bitcart version is A.B.C.D, and I deployed my server on Digital Ocean by following Docker deployment guide. I've searched through the FAQ and closed GitHub issues, but there's no solution to my problem. My Bitcart Setup is XYZ, and the issue is occurring when I do XYZ. Here are the logs I was able to get from my Bitcart instance. You can see the error in the image I attached.

WARNING

The community will not provide extensive support for custom deployments. I.e. Variations of [Manual Deployments](/deployment/manual) are expected to be used only for development purposes and by users with technical literacy with the ability to **resolve deployment and maintenance issues on their own**.

### 4.1 Asking the community (general problems)

For quick answers to fundamental problems, it's best to post a question in one of our [communities](https://bitcart.ai/#community).

### 4.2 Opening an Issue on GitHub (advanced problems)

If you have a custom build setup and are facing a complex problem, [open an issue on GitHub](https://github.com/bitcart/bitcart/issues) so that developers can help you out.

### 4.3 Premium Support

Some community members provide paid support. If you want a quicker help, check out the list of [members providing premium support](/support-and-community/support#paid-support).


# Contribute

Bitcart is built and maintained entirely by volunteer contributors around the internet. We welcome and appreciate new contributions.

If you're a developer looking to help, but you're not sure where to begin, check the [good first issue label](https://github.com/bitcart/bitcart/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22), which contains small pieces of work that have been specifically flagged as being friendly to new contributors.

Contributors looking to do something a bit more challenging, before opening a pull request, please [create an issue](https://github.com/bitcart/bitcart/issues/new/choose) or join [our community chat](https://t.me/bitcart) to get early feedback, discuss best ways to tackle the problem and to ensure there is no work duplication.

You can help Bitcart even if you're not a developer.

The easiest way is to use the software as a business or individual, provide feedback and [report any bugs or issues](https://github.com/bitcart/bitcart/issues) you or your customers encounter.

Translating Bitcart, helping us with [documentation](https://github.com/bitcart/bitcart-docs/issues), making videos, writing articles and spreading the word are ways in which you can help, even if you're not a developer or tech-savvy.

We need more VPS hosting providers to implement 1-Click Bitcart deployment and make the installation of software more accessible, decentralized and widely-available.

We are actively looking for developers who can take on and resolve GitHub issues and help with development. If you would like to help us, but need some guidance, [our community chat](https://t.me/bitcart) is the place to ask questions. Also, take a look at our [contributing guidelines](https://github.com/bitcart/bitcart/blob/master/CONTRIBUTING.md).


# Community

This project is nothing without its community!

Join us:

[Telegram](https://t.me/bitcart)

[Github](https://github.com/bitcart/bitcart)

[More communities](https://bitcart.ai/#community)


# Architecture

![Bitcart structure diagram](/files/-MPiMXwmIrmHdKYH0V3X)

Bitcart is a complex project, and this page contains a detailed description of Bitcart structure.

Check the diagram, it shows that Bitcart is modular, as it consists of many independent components. The only required component is Bitcart Core, everything else is optional.

## Bitcart Core

Bitcart core are essentially the Bitcart daemons for different currencies.

Bitcart daemon is just a wrapper around electrum wallet, extending existing daemon functionality and providing more methods, wallet loading on the fly (by passing xpub as part of the JSON-RPC request), better events delivery (supports polling, websocket) and a specification for better exceptions to improve development time.

So, all the networking and essential crypto parts are managed by electrum, which is battle-tested.

How does the networking work and why is it so light?

It's because electrum is an SPV (Simple Payment Verification) wallet, connecting to multiple public servers and verifying them, selecting only the valid ones. That way it is still secure but also lightweight.

## Merchants API

If you want to add Merchants API, it will also add in PostgreSQL for data storage, and Redis for cache and inter-process communication, plus the background worker to process background tasks (check for updates, check hidden service availability) and to check invoices' payments.

The background worker estabilishes a websocket connection to the daemon, one for each currency enabled.

Upon successful payment, electrum networking and wallet functionality detects that payment request was paid, and fires an event. Our daemon is configured to preprocess the event (to get maximum possible data), and to send it to configured sources. In this case, new event data is sent via websocket.

Websocket data is received by the worker via Bitcart SDK, and a corresponding event handler is called.

The worker finds a payment method and an invoice related to that payment method having the address sent, and it marks the invoice as complete. When marking invoice as complete, multiple actions are done:

* Paid currency is set
* Email message is built by configured templates and is sent to the customer, if email server is configured and there was buyer email specified
* All connected notification providers are used to notify the merchant
* And other tasks to be added in the future, like executing custom scripts

In case of a temporary connection failure, on successful re-connect to websocket, the worker will fetch and check pending invoices to process missed events.

Background tasks are ran periodically by the worker, like, checking updates once a day, refreshing hidden services every 15 minutes, etc.

The Merchants API provides an easy way of managing common data in store-like applications, so you don't need to re-create it all from scratch. But you are free to use just the daemons with the SDK.

## Admin Panel

Optionally, you may also add the admin panel. It is a convenience UI built around the Merchants API, so it requires Merchants API to be enabled if using local one.

It provides ultimate editing features, and is very powerful as it's built in material design.

The admin panel also provides a universal checkout page, and a script which can be used to launch [checkout modal](/integrations/custom-integration#bitcart-admin-panels-checkout-modal) on any site

## Ready Store (POS)

Optionally, you may also add our ready store (POS).

It also depends on the Merchants API, and it is a lightweight UI to accept payments in an online store without need in developing a custom store. It has it's own checkout page and is independent of the admin panel

## Tor

Tor support is optional, but if you enable it, all the services (merchants API, admin, store) will also be accessible via the onion network.

Check [this guide](/guides/tor) for more information

## Nginx and Let's Encrypt

Nginx is serving all the incoming requests, from multiple configured domains, and is forwarding traffic to different components of the ecosystem. It is essential for production setup.

Optionally, you may enable ssl support via let's encrypt. It works via a small docker container, automatically refreshing your certificates once in a while


# Developing Locally

As Bitcart consists of many components, each component has it's individual installation instructions.

Please follow our main [contributing guidelines](https://github.com/bitcart/bitcart/blob/master/CONTRIBUTING.md), and the guidelines specific to the repository you are contributing to.

Our central repository contains the list of most of the repositories where you can contribute:

{% embed url="<https://github.com/bitcart/bitcart#linked-repositories>" %}

## Which IDE to use?

We recommend using Visual Studio Code, as our project has many programming languages involved, and VS Code fits the best, but you are free to use whatever editor you like.


# How to add an Altcoin

## Altcoins

Bitcoin (and the original electrum) is the primary focus of the developers. When developing, we usually test two currencies just to check that multicurrency checkout works, but we don't check every coin frequently. Each coin's communities should maintain their coins.

For more information, checkout the [Altcoin FAQ](/support-and-community/faq/altcoin-faq) page.

## How do I add an altcoin?

As Bitcart is made with extensibility in mind, it's usually not a hard process, but it depends on the coin you are adding

It all depends on whether there is an electrum fork for that coin

### There is an electrum fork for that coin

If so, the process is easy. If that electrum fork is maintained, usually the process is the following:

1. Add new daemon file, `daemons/coin.py`, in the main `bitcart` repository, where `coin` is your coin's code. Copy the code from the `daemons/btc.py` file and edit some metadata. Note that the default port for the coin must be in 5XXX range, and that you should increment it by one with each added coin. So find the latest port used, and use the next port number available. Check this [diff](https://github.com/bitcart/bitcart/commit/2a13147bc959634b956a42faed9369e953507703#diff-2f08b8651c7e34c35c8ee95b21766ea34b7f48004931d1a4c49fee4e673ea4ad) for an example, but make sure to check the most up-to-date files.
2. Add a requirements file (`requirements/daemons/coin.txt`), and pin electrum of that coin to some specific release. See this [example](https://github.com/bitcart/bitcart/commit/2a13147bc959634b956a42faed9369e953507703#diff-0ecc9f34c35e656d4f79678b2e479437f7fefe2221dd0a769839d83be9423413)
3. Add the coin's decimal formatting settings, edit the `api/ext/moneyformat/currencies.json` [file](https://github.com/bitcart/bitcart/blob/master/api/ext/moneyformat/currencies.json) and add settings related to your currency. See the example crypto settings at the bottom of that file.
4. Add the coin to our SDK. Create a file `bitcart/coins/coin.py`, and edit some metadata. See this [example](https://github.com/bitcart/bitcart-sdk/commit/f32acdca5ad6e3dc3cf5ae830fe12d91509702f1).
5. Add the coin to our docker deployment:

   Create a docker file for that coin (base on the btc one), a docker-compose component and edit the setup scripts. See this [example](https://github.com/bitcart/bitcart-docker/commit/34e70b5a265ac23182d19cb95b457815937724b9). Ensure to add `COIN_HOST=component` line to this [file](https://github.com/bitcart/bitcart-docker/blob/master/dev-setup.sh), where `COIN` is the coin symbol, and `component` is the name of the docker-compose component you have created

## There is no electrum fork for that coin

That's where things get a little bit more complex. You have two ways: either fork the electrum yourself and make it work for your coin, or, if your coin is completely different from btc-like coins, try to create an electrum-compatible daemon. If you do it correctly, you just need to implement the `daemons/coin.py` file in a completely custom way, plus make sure to have all the daemons dependencies in the requirements file, but otherwise, the process is the same as when [there is a fork available](#there-is-an-electrum-fork-for-that-coin) for that coin.


# Security Disclosures

### Reporting a Vulnerability

To report security issues send an email to <bitcartservices@gmail.com>.

Please do not announce of the vulnerability publicly until the fix is released. Thank you.

The following keys may be used to communicate sensitive information to developers:

| Name       | Fingerprint                                       |
| ---------- | ------------------------------------------------- |
| MrNaif2018 | AB22 4F6F 2ED1 1812 47E7 1D83 5CDE 5043 6C3D B40C |

You can import a key by running the following command with that individual’s fingerprint: `gpg --recv-keys "<fingerprint>"` Ensure that you put quotes around fingerprints containing spaces.

After the initial reply to your report, you will be informed of the progress towards a fix and full announcement. You may be asked to provide additional information or guidance.

We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.


