VPN for friends Deploying our VPN server with payment through Telegram

31 May 2023 7 minutes Author: D2-R2

Create your own VPN server for friends with Telegram payment

Telegram is a popular messenger that offers a wide range of features for messaging, media and group communication. It supports a variety of platforms, including mobile devices and computers, and offers secure data encryption to ensure user privacy. In addition, Telegram also provides the ability to create channels, bots and communities to spread information, conduct surveys and perform various tasks. In general, Telegram is popular among users who value privacy, security and multi-functionality in their communication. Security and privacy online are becoming more and more important, and using your own VPN server can be the perfect solution to keep your data and internet connection safe. With our guide, you will be able to quickly and easily deploy your own VPN server for friends, with payment through Telegram.

Our guide will provide you with all the information and steps you need to follow to set up a VPN server using Telegram as a payment system. You will learn about choosing the right software, configuring the server and securing the connection. Our guide is easy to use and designed for both beginners and advanced users. You can ensure security and privacy for yourself and your friends by creating your own paid VPN server through Telegram. Protect your data and internet connection with our help! Order our seo guide right now and become an expert in deploying a paid VPN server via Telegram. Keep yourself and your friends safe and private with your own VPN server.

Let’s start!

In this article, I will not only show you how to create your own VPN service based on WireGuard, but also how to set it up for all your friends and acquaintances. And even, if you want, try your luck at hosting using a simple Telegram bot.

The ability to encrypt traffic and proxy for other countries is now so important that I won’t waste your time and list again all the cases when you can’t do without a VPN. At the same time, most users choose ready-made services: free, but unreliable and with built-in advertising and tracking, or paid, but expensive compared to hosting.

To create your VPN, you’ll need to play around with the command line. For enthusiasts like you and me, such an activity is a joy: I, having no experience, set up such a service in one evening. Friends started asking if it was possible to get such a live, reliable and cheap service. However, none of them wanted to mess with the settings.

I spent many hours creating and distributing ready-made configurations, but then I got bored. Then I decided to create my own solution with fast deployment, Telegram administration and time quota for users. In this article, I will explain this in more detail and share all the necessary resources for implementation.


By providing a proxy service to third parties through hosting registered with you, you assume responsibility for all their actions on the network. Don’t forget to discuss in advance what you can and can’t do with your IP address. And if you plan to provide a commercial service, think about concluding an agreement that will relieve you of responsibility.


I chose WireGuard because of its speed compared to OpenVPN and IPSec. Just look at these graphs.

Similar statistics are shown by Protectli and Entrostat tests. In Linux, WireGuard works at the kernel level, which gives an additional speed boost.

WireGuard does not have as large a selection of asymmetric ciphers as OpenVPN and other protocols. But this is also a plus: a smaller attack surface for the protocol.


So what does it look like for a user to interact with my robot? Let’s start familiarization with the main menu.

During the first login, the user receives a welcome message from the bot and registers for the test. In the bot’s configuration, you can manually set all the texts and settings, such as the time to provide the subscription. In the main menu, the user can check the status of his subscription, continue and get set up with detailed instructions for connecting, and in the “Continue” section, he can purchase a subscription for a certain period of time.

Payment is made online through Telegram itself. Accordingly, we can choose any payment system with which Telegram cooperates.


I planned to use Qiwi for payments because there is an open API to generate invoices and no need to be a freelancer or IP. Unfortunately, Qiwi recently stopped issuing the necessary tokens and does not announce a resumption date. However, you will find an admin panel option for Qiwi in the original sources. Once the user has selected and paid for the subscription, they will receive a notification of successful payment and the subscription information will be updated immediately.

In the “How to connect” section, the user can get his config to connect to the VPN server and detailed instructions on how to set up WireGuard on his phone and how to use it.

And finally, the most important section is the “Admin panel”, which only the bot admin can access.

The “Remove users” section allows you to get a list of all users of the system or only users with a paid subscription.

In the “Edit user by id” section, by entering the user’s Telegram ID, we can add an hour or reset it (that is, take away the subscription).

The “Static Users” section may be needed to provide VPN access to users who are not registered with Telegram. In this section we can create static users, delete them and get connection configs.


I have introduced you to what the bot looks like, now I will show you the settings and a script that deploys and configures WireGuard in a couple of clicks.

Let’s start with bot configs. The first config is called config.json, it contains the basic settings of the bot.

  • admin_tg_id – Telegram ID of the admin. You can find out your ID from the bot  userinfobot .

  • one_month_cost – price in rubles per month of subscription. The minimum amount in rubles should be the equivalent of one dollar, but as practice has shown, it is worth paying a little more than the current dollar rate. The course that Telegram uses can be found at  official website.

  • trial_period -trial subscription period. The default is 45 minutes, which is 2700 seconds.

  • UTC_time – Time zone in UTC format. The robot will take it into account when displaying the hour. By default, UTC+3 is set, i.e. Moscow time.

  • tg_token -bot token received from  @BotFather .

  • tg_shop_token – store token in Telegram. Required if we want to accept payment. If you leave this value empty, then the bot will simply not send the payment form and, accordingly, online payment will not be available.

Як отримати  tg_shop_token? Go to Telegram to the bot  @BotFather  and write /mybots. Then choose the desired bot and go to the Payments section. Here you can familiarize yourself with all available payment systems and learn how to connect them. After connecting the payment system, return to BotFather. The security key should appear in the Payments section.

And the last configuration file stores the text of messages that the bot sends to users. Messages can be formatted using Telegram’s HTML styles, and you can see how to use them documentation. .

I think it is quite clear which message I am responsible for.

Other related articles
Found an error?
If you find an error, take a screenshot and send it to the bot.