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

Download latest server build here.



Java 8 required. (OpenJDK, Oracle).

Ubuntu installation instructions can be found here.

For Windows download Java here and install.

Quick local server setup

  • Make sure you are using Java 8java -versionOutput: 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.23.0.jar -dataFolder /path

That's it!

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

  • As an output you should 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 8java -versionOutput: java version "1.8.0_40"
  • Download Blynk server jar file (or manually copy it to Raspberry Pi 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.23.0.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.23.0.jar -dataFolder /home/pi/Blynk &
  • Or if the approach above doesn't work, executecrontab -e

add the following line

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

save and exit.

Enabling server auto restart on Windows

  • Create bat file:start-blynk.bat
  • Put in it one line:java -jar server-0.23.0.jar -dataFolder /home/pi/Blynk
  • Put bat file to windows startup folder

You can also use this script to run server.

Update instruction for unix-like systems

IMPORTANT Server should be always updated befor you update Blynk App. To update your server to a newer version you would need to kill old process and start a new one.

  • Find process id of Blynk  serverps -aux | grep java   
  • You should see something like thatusername   10539  1.0 12.1 3325808 428948 pts/76 Sl   Jan22   9:11 java -jar server-0.23.0.jar      
  • Kill the old process kill 10539 

10539 - blynk server process id from command output above.

After this steps you can update Blynk app. Server version downgrade is not supported.

☝️ ⚠️ WARNING! Please do not revert your server to lower versions. You may loose all of your data.

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


  • Change your ethernet sketch from Blynk.begin(auth); to 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));  to 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()});  to var blynk = new Blynk.Blynk(AUTH, options= {addr:""}); 
  • or if you use USB when running provide '-s'   option with address of your local server ./ -s you_host_or_IP  

Blynk is under continuous development. Mobile apps and server are frequently updated. To avoid issues during updates either turn off auto-update for Blynk app, or update both local server and blynk app at same time to avoid possible migration issues.

Blynk Local Server is different from Blynk Cloud server. They are not related at all. 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. You can do the same with via -mailConfig and via -smsConfig.

For example:

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

Available server options:

  • Application mutual ssl/tls portapp.ssl.port=8443
  • Hardware plain tcp/ip porthardware.default.port=8442
  • Hardware ssl/tls port (for hardware that supports SSL/TLS sockets)hardware.ssl.port=8441
  • For simplicity Blynk already provides server jar with built 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.server.ssl.cert=./server_embedded.crtserver.ssl.key=./server_embedded.pemserver.ssl.key.pass=pupkin123
  • Https and web sockets porthttps.port=9443
  • Http and web sockets porthttp.port=8080
  • User profiles folder. Folder in which all users profiles will be stored. By default System.getProperty("")/blynk used. Will be created if not existsdata.folder=/tmp/blynk
  • Folder for all application logs. Will be created if it doesn't exist. "." is dir from which you are running script.logs.folder=./logs
  • Log debug level. Possible values: trace|debug|info|error. Defines how precise logging will be. From left to right -> maximum logging to minimumlog.level=trace
  • Maximum allowed number of user dashboards.user.dashboard.max.limit=100
  • 100 Req/sec rate limit per user. You also may want to extend this limit on hardware side.user.message.quota.limit=100
  • this setting defines how often you can send mail/tweet/push or any other notification. Specified in secondsnotifications.frequency.user.quota.limit=60
  • Maximum allowed user profile size. In Kb's.user.profile.max.size=128
  • Number of strings to store in terminal widget (terminal history data)terminal.strings.pool.size=25
  • 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 reachednotifications.queue.limit=10000
  • 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.blocking.processor.thread.pool.limit=5
  • Period for flushing all user DB to disk. In
  • 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 timeoutapp.socket.idle.timeout=600
  • 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 timeouthard.socket.idle.timeout=15
  • Mostly required for local servers setup in case user want to log raw data in CSV format. See raw data section for more
  • Administration UI https portadministration.https.port=7443
  • Url for opening admin page. Must start from "/". For "/admin" url path will look like that "".admin.rootPath=/admin
  • 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
  • Comma separated list of users allowed to create accounts. Leave it empty if no restriction,

Administration UI

Blynk server provides administration panel where you can monitor your server. It is accessible at this URL:


You can change it with next options :


WARNING Default allowed.administrator.ips setting allows access only from localhost. In other words, administration is not available from any other computer except from the one you are running the server on.


Blynk HTTP/S RESTful API allows to easily read and write values to/from Pins in Blynk apps and Hardware. Http API description could be found here.

Enabling mail on Local server

To enable mail notifications on Local server you need to provide your own mail credentials. Create file within same folder where server.jar is. Mail properties:


Find 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

To enable SMS notifications on Local Server you need to provide credentials for SMS gateway (currently Blynk server supports only 1 provider - Nexmo). You need to create file within same folder where server.jar is.


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

Enabling raw data storage

By default raw data storage is disabled (as it consumes disk space a lot). When you enable it, every Blynk.virtualWrite command will be saved to DB. You will need to install PostgreSQL Database to enable this functionality:

1. Enabling raw data on server

Enable raw data in :

2. Option A. Install PostgreSQL

sudo sh -c 'echo "deb `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
    wget -q -O - | sudo apt-key add -

    sudo apt-get update
    sudo apt-get install postgresql postgresql-contrib

2. Option B. Install PostgreSQL

sudo apt-get update
apt-get --no-install-recommends install postgresql-9.6 postgresql-contrib-9.6

3. Download Blynk DB script

    wget    server/master/server/core/src/main/resources/create_schema.sql

4. Get full path of downloaded file

    readlink -f create_schema.sql



Copy it to clipboard from your console.

5. Connect to PostgreSQL

    sudo su - postgres

6. Create Blynk DB, test user and tables

    \i /root/create_schema.sql

 - is path from step 4.

You should see next output:

    postgres=# \i /root/create_schema.sql
    You are now connected to database "blynk" as user "postgres".



Now start your server and you should see next text in postgres.log file :

    2017-03-02 16:17:18.367 - DB url : jdbc:postgresql://localhost:5432/blynk?tcpKeepAlive=true&socketTimeout=150
    2017-03-02 16:17:18.367 - DB user : test
    2017-03-02 16:17:18.367 - Connecting to DB...
    2017-03-02 16:17:18.455 - Connected to database successfully.

WARNING: Raw data may consume your disk space very quickly!

CSV data format

Data format is:


For example:


Where 10 - value of pin, and 1438022081332 - the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC. To display the date/time in excel you may use formula:


Automatic Let's Encrypt certificates generation

Latest Blynk server has super cool feature - automatic Let's Encrypt certificates generation. However, it has few requirements:

  • Add property in file. For example (IP is not supported, this is the limitation of Let's Encrypt) :
  • Add property in For example :
  • You need to start server on port 80 (requires root or admin rights) or make port forwarding to default Blynk HTTP port - 8080.

That's it! Run server as regular and certificates will be generated automatically.

Manual Let's Encrypt SSL/TLS Certificates

  • First install certbot on your server (machine where you going to run Blynk Server)  wget  chmod a+x certbot-auto
  • Generate and verify certificates (your server should be connected to internet and have open 80/443 ports)  ./certbot-auto certonly --agree-tos --email YOUR_EMAIL --standalone -d YOUR_HOST

For example

    ./certbot-auto certonly --agree-tos --email --standalone -d
  • Then add to your file (in folder with server.jar)  server.ssl.cert=/etc/letsencrypt/live/YOUR_HOST/fullchain.pem  server.ssl.key=/etc/letsencrypt/live/YOUR_HOST/privkey.pem  server.ssl.key.pass=

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

If you connect hardware with USB script you have to provide an option '-s' pointing to "common name" (hostname) you did specified during certificate generation.

As an 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

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

How Blynk Works?

When hardware connects to Blynk cloud it opens either keep-alive ssl/tls connection on port 8441 or keep-alive plain tcp/ip connection on port 8442. Blynk app opens mutual ssl/tls connection to Blynk Cloud on port 8443. Blynk Cloud is responsible for forwarding messages between hardware and app. In both (app and hardware) connections Blynk uses
own binary protocol described below.

Blynk protocol

Blynk transfers binary messages with the following structure:

Message Id and Length are big endian. Body has a command-specific format.

Command and Status definitions: BlynkProtocolDefs.h

Typical Blynk library knows how to send(S)/process(P):

S   BLYNK_CMD_LOGIN + auth token


GNU GPL license

Did this answer your question?