blynk-server 0,0,0,1 travis-ci

Platform with iOs and Android apps to control Arduino, ESP8266, Raspberry Pi and similar microcontroller boards over the Internet.

What is Blynk?

Blynk is a platform with iOS and Android apps to control Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your projects by simply dragging and dropping widgets. If you need more information, please follow these links: * Blynk site * Blynk docs * Blynk community * Facebook * Twitter * App Store * Google Play * Blynk library * Kickstarter

Dashboard settings Widgets Box Button edit terminal edit Dashboard Dashboard2

Blynk server

Blynk Server is an Open-Source Netty based Java server, responsible for forwarding messages between Blynk mobile application and various microcontroller boards (i.e. Arduino, Raspberry Pi. etc). Download latest server build here.

GitHub version GitHub download Build Status



Java 8 required. (OpenJDK, Oracle).

Ubuntu installation instructions here.

For Windows just download from here and install.

Quick local server setup

  • Make sure you are using Java 8

    java -version
    Output: java version "1.8.0_40"
  • Run the server on default ‘hardware port 8442’ and default ‘application port 8443’ (SSL port)

    java -jar server-0.18.3.jar -dataFolder /path

That’s it!

NOTE : /path should be real existing path to folder where you want to store all your data.

  • As output you will see something like that :

    Blynk Server successfully started.
    All server output is stored in current folder in 'logs/blynk.log' file.

Quick local server setup on Raspberry PI

  • Login to Raspberry Pi via ssh;

  • Install java 8 :

    sudo apt-get install oracle-java8-jdk
  • Make sure you are using Java 8

    java -version
    Output: java version "1.8.0_40"
  • Download Blynk server jar file (or manually copy it to raspberry via ssh and scp command) :

    wget ""
  • Run the server on default ‘hardware port 8442’ and default ‘application port 8443’ (SSL port)

    java -jar server-0.18.3.jar -dataFolder /home/pi/Blynk        

That’s it!

  • As output you will see something like that :

    Blynk Server successfully started.
    All server output is stored in current folder in 'logs/blynk.log' file.

Enabling server auto restart on unix-like systems

  • To enable server auto restart find /etc/init.d/rc.local file and add :

    java -jar /home/pi/server-0.18.3.jar -dataFolder /home/pi/Blynk &
  • Or in case above approach doesn’t work for you, execute

    crontab -e

add the following line

    @reboot java -jar /home/pi/server-0.18.3.jar -dataFolder /home/pi/Blynk &

save and exit.

Enabling server auto restart on Windows

  • Create bat file :

  • Put in it one line :

    java -jar server-0.18.3.jar -dataFolder /home/pi/Blynk
  • Put bat file to windows startup folder

You can also use this ready script to run server.

Update instruction for unix-like systems

In order to update your server with new version you need to kill old process and start new one.

  • Find process id of Blynk server

    ps -aux | grep java
  • You will see something like that

    username   10539  1.0 12.1 3325808 428948 pts/76 Sl   Jan22   9:11 java -jar server-0.18.3.jar   
  • Kill old process

    kill 10539

10539 - blynk server process id from command output above.

Update instruction for Windows

  • Open Task Manager;

  • Find Java process;

  • Stop process;

  • Start new server as usual

App and sketch changes

  • Specify custom server path in your application

Custom server icon Server properties menu

  • Change your ethernet sketch from



    Blynk.begin(auth, "your_host");

    or to

    Blynk.begin(auth, IPAddress(xxx,xxx,xxx,xxx));
  • Change your WIFI sketch from

    Blynk.begin(auth, SSID, pass));


    Blynk.begin(auth, SSID, pass, "your_host");

    or to

    Blynk.begin(auth, SSID, pass, IPAddress(XXX,XXX,XXX,XXX));
  • Change your rasp PI javascript from

    var blynk = new Blynk.Blynk(AUTH, options = {connector : new Blynk.TcpClient()});


    var blynk = new Blynk.Blynk(AUTH, options= {addr:""});
  • or in case of USB when running provide ‘-s’ option with address of your local server

    ./ -s you_host_or_IP

WARNING : Blynk is growing very quickly. And both apps and server constantly updated. In order to avoid problems during updates either turn off auto-update for Blynk app either update both local server and blynk app at same time to avoid possible migration issues.

WARNING : Blynk local server is not Blynk cloud server. They are not related at all. So you have to create new account when using Blynk local server.

Advanced local server setup

For more flexibility you can extend server with more options by creating file in same folder as server.jar. Example could be found here. You could also specify any path to file via command line argument -serverConfig. For example :

java -jar server-0.18.3.jar -dataFolder /home/pi/Blynk -serverConfig /home/pi/someFolder/

Possible server options:

  • Application mutual ssl/tls port

  • Hardware plain tcp/ip port

  • Hardware ssl/tls port (for hardware that supports SSL/TLS sockets)

  • For simplicity Blynk already provides server jar with build-in SSL certificates, so you have working server out of the box via SSL/TLS sockets. But as certificate and it’s private key are in public this is totally not secure. So in order to fix that you need to provide your own certificates. And change below properties with path to your cert. and private key and it’s password. See how to generate self-signed certificates here

    #points to cert and key that placed in same folder as running jar.
  • Web socket ssl/tls port

  • Web sockets plain tcp/ip port

  • Https port

  • Http port

  • User profiles folder. Folder in which all users profiles will be stored. By default System.getProperty(“”)/blynk used. Will be created if not exists

  • Folder for all application logs. Will be created if it doesn’t exist. “.” is dir from which you are running script.

  • Log debug level. Possible values: trace|debug|info|error. Defines how precise logging will be. From left to right -> maximum logging to minimum

  • Maximum allowed number of user dashboards.

  • 100 Req/sec rate limit per user. You also may want to extend this limit on hardware side.

  • this setting defines how often you can send mail/tweet/push or any other notification. Specified in seconds

  • Maximum allowed user profile size. In Kb’s.

  • Number of strings to store in terminal widget (terminal history data)

  • Maximum allowed number of notification queue. Queue responsible for processing email, pushes, twits sending. Because of performance issue - those queue is processed in separate thread, this is required due to blocking nature of all above operations. Usually limit shouldn’t be reached

  • Number of threads for performing blocking operations - push, twits, emails, db queries. Recommended to hold this value low unless you have to perform a lot of blocking operations.

  • Period for flushing all user DB to disk. In millis
  • Specifies maximum period of time when application socket could be idle. After which socket will be closed due to non activity. In seconds. Leave it empty for infinity timeout

  • Specifies maximum period of time when hardware socket could be idle. After which socket will be closed due to non activity. In seconds. Leave it empty for infinity timeout

  • Mostly required for local servers setup in case user want to log raw data in CSV format. See raw data section for more info.
  • Administration UI https port

  • Url for opening admin page. Must start from “/”. For “/admin” url path will look like that “”.

  • Comma separated list of administrator IPs. Allow access to admin UI only for those IPs. You may set it for to allow access for all. You may use CIDR notation. For instance,

  • Host for reset password redirect. By default current server IP is taken from “eth” network interface. Could be replaced with more friendly hostname. It is recommended to override this property with your server IP to avoid possible problems of host resolving.
  • Comma separated list of users allowed to create accounts. Leave it empty if no restriction required.

    [email protected],[email protected]

Administration UI

Blynk server also has administration panel where you could monitor your server. It could be accessible with URL.


Administration UI

You can change it with next options :


WARNING : default allowed.administrator.ips setting allows access only from localhost. In other words administration will not be available from any other machine except those one you are running server on.


Blynk HTTP RESTful API allows to easily read and write values to/from Pins in Blynk apps and Hardware. For now API available only for Local Blynk Servers. Http API description could be found here.

Enabling mail on Local server

In order to enable mail notifications on Local server you need to provide own mail credentials. To do that you need to create file within same folder where server.jar is. Mail properties :


See example here.

NOTE : you’ll need to setup Gmail to allow less secured applications. Go here and then click “Allow less secure apps”.

Enabling sms on local server

In order to enable sms notifications on Local Server you need to provide credentials for sms gateway (for now Blynk server supports only 1 provider - Nexmo). So to do that you need to create file within same folder where server.jar is.


And fill above properties with credentials you’ll get from Nexmo. (Account -> Settings -> API settings). You also can send sms via email in case your cell provider supports that. See discussion for more details.

Raw data storage

By default raw data storage is enabled. So any write (Blynk.virtualWrite) command will stored on disk. The default path is “data” folder within data.folder property of server properties.

File name format is


For instance


Which means in 1_v5.csv file stored raw data for virtual pin 5 of dashboard with id 1.

Data format is


For instance


Where 10 - value of pin, and 1438022081332 - the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.

Raw data files are rotated every day and gzipped.

WARNING : this will changed in near future.

Generate Let’s Encrypt SSL/TLS Certificates

  • First install certbot on your server (machine where you gonna run Blynk Server)

    chmod a+x certbot-auto
  • Generate and verify certificates (your server should be connected to internet and have open 80443 ports)

    ./certbot-auto certonly --agree-tos --email YOUR_EMAIL --standalone -d YOUR_HOST

For example

    ./certbot-auto certonly --agree-tos --email [email protected] --standalone -d
  • Add password to your let’s encrypt certificate and reformat it:

    mkdir /srv/blynk-data
    cp /etc/letsencrypt/live/YOUR_HOST/fullchain.pem /srv/blynk-data
    cp /etc/letsencrypt/live/YOUR_HOST/privkey.pem /srv/blynk-data
    cd /srv/blynk-data
    openssl pkcs8 -topk8 -inform PEM -outform PEM -in privkey.pem -out privkey_pass.pem
  • Then add to your file (in folder with server.jar)


Generate own SSL certificates

  • Generate self-signed certificate and key

    openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout server.key -out server.crt
  • Convert server.key to PKCS#8 private key file in PEM format

    openssl pkcs8 -topk8 -inform PEM -outform PEM -in server.key -out server.pem

WARNING : you should have password for certificate. Certificates without pass are not accepted. In case you connect hardware via USB script you have to provide an option ‘-s’ pointing to “common name” (hostname) you did specified during certificate generation.

As output you’ll retrieve server.crt and server.pem files that you need to provide for server.ssl properties.

Install java for Ubuntu

    sudo apt-add-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java8-installer

Port forwarding for HTTP/S API

    sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
    sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 9443

Enabling QR generation on server

    sudo apt-get install libxrender1

Add JVM param during server launch


Behind wifi router

If you want to run Blynk server behind WiFi-router and want it to be accessible from the Internet, you have to add port-forwarding rule on your router. This is required in order to forward all of the requests that come to the router within the local network to Blynk server.

How to build

Blynk has a bunch of integration tests that require DB, so you have to skip tests during build.

    mvn clean install -Dmaven.test.skip=true

Minimal requirements

Blynk server is very powerful it can handle 1000 devices on single raspberry PI.

  • Any OS that can run java
  • At least 30 MB of RAM (could be less with tuning)


GNU GPL license

Related Repositories



Platform with iOs and Android apps to control Arduino, ESP8266, Raspberry Pi and similar microcontroller boards over the Internet. ...



Node.js module for accessing Blynk server through the App interface ...



Docker image that runs the Blynk server ...

Top Contributors

doom369 artem-v igaidai4uk blynkkk azakordonets storozhukBM pasxa wbadry franga2000


-   v0.18.3 zip tar
-   v0.18.2 zip tar
-   v0.18.1 zip tar
-   v0.18.0 zip tar
-   v0.17.2 zip tar
-   v0.17.1 zip tar
-   v0.17.0 zip tar
-   v0.16.4 zip tar
-   v0.16.3 zip tar
-   v0.16.2 zip tar
-   v0.16.1 zip tar
-   v0.16.0 zip tar
-   v0.15.4 zip tar
-   v0.15.3 zip tar
-   v0.15.2 zip tar
-   v0.15.1 zip tar
-   v0.15.0 zip tar
-   v0.14.1 zip tar
-   v0.14.0 zip tar
-   v0.13.4 zip tar
-   v0.13.3 zip tar
-   v0.13.2 zip tar
-   v0.13.1 zip tar
-   v0.13.0 zip tar
-   v0.12.6 zip tar
-   v0.12.5 zip tar
-   v0.12.4 zip tar
-   v0.12.3 zip tar
-   v0.12.2 zip tar
-   v0.12.1 zip tar