Creating a Local Blynk Server

Introduction: Creating a Local Blynk Server

About: #BnBe is a platform to help teach electronics no matter what the age or skill level. We’re currently designing a wide range of products from beginner level kits to industry-standard microcontroller platforms.

In this post, we learn how to create a local Blynk server which will greatly reduce the overall latency that is sometimes present when using the default, remote server. We set it up using a Pi Zero W and we also create a demo project to make sure it is all working correctly.

Step 1: Watch the Video

The video above goes through all the details that you need to know to set up the server. Please watch that first for an overview to understand how everything comes together.

Step 2: Configure the Pi

I decided to use the desktop version of Raspbian though you could also use the Lite version and do everything using the terminal. You can use the following link for the official installation instructions but I have covered the important steps below:

Once you have the Raspberry PI setup, run the following commands to install Java and then download the server file:

  • sudo apt install openjdk-8-jdk openjdk-8-jre
  • wget ""

Once that is done, all we need to do is use crontab to automate the server at boot. That can be done by running the following command to open up crontab:

  • crontab -e
Scroll down to the bottom of the file and then type in the following:
  • @reboot java -jar /home/pi/server-0.41.12-java8.jar -dataFolder /home/pi/Blynk &
Save the file by typing CTRL+X, then Y, then pressing the ENTER key.
The Blynk server sends an email with the authentication token for each project. For this to work, we need to configure the mail settings by creating a new file. That can be done by running the following command:
  • sudo nano

We need to add the email settings in this file along with the details of an email account. Please use the GitHub link to obtain the lines that need to be added or refer to the video for more details.

The final step is rebooting the board which can be done by running the following command:

  • sudo reboot

Step 3: Configure the App

Download the Blynk app or logout if you already have it. Click the option to create a new account and then click the icon at the bottom of the screen to enter the server details. Click the custom option and enter the IP address of your raspberry Pi. Then, provide a valid email address and enter a password to create an account on your local server.

You can now use Blynk normally but as a test, create a demo project to toggle pin D1 on the WeMos D1 mini board. That's all you need to do here.

Step 4: Configure the Board

You will receive an email with the authentication token for your project. Open up the Arduino IDE, make sure you have installed the Blynk library using the library manager and then open the nodemcu example sketch.

Add your authentication token, WiFi network details, and then be sure to comment out the default server connection line as we need to add the local server IP address as shown in the image/video. Then, upload the sketch to the board and open the serial monitor to view the output. It should first successfully connect to your WiFi network and it will then connect to the server and if successful, it will give you the "Ready" message.

Step 5: Test the Setup

Open the app and click the run button. Now, you will be able to control the GPIO state using the button.

Be the First to Share


    • Remote Control Contest

      Remote Control Contest
    • Stone Concrete Cement Contest

      Stone Concrete Cement Contest
    • First Time Author Contest

      First Time Author Contest


    Mr Wigs
    Mr Wigs

    Question 1 year ago

    I'm having trouble getting through step 2 of your instructions. I've figured out that we're now on version 0.41.14 of the Blynk server, and it appears that all the previous commands have worked, but I am unable to connect to the server using my MacBook Pro at address I never get to the warning screen shown at the 3:22 mark in your video. I'm using RPi Zero W with Buster Lite. Do I need a Blank account set-up before this will work? Any other ideas or questions you may have?


    Answer 1 year ago

    Hi, Bnbe uses https instead http, so maybe it will help