Vaadin on Heroku


is one of those Cloud platform where you can host your Java web application.
It’s free if you have small needs, like for an application that only require one
and no database or a very small database.

I’ve made an “Hello wolrd” application that use the add-on
Embed for Vaadin
and run it on Heroku, with sessions stored in memcached.

Details and source code can be found in the
github repository

The deployed application can be reached at


This was exactly what I was looking for. Thank you for the awesome tutorial! I ran into a few problems myself trying to recreate from scratch. For some reason, per Heroku logs, Heroku was not able to detect my web process. I added the Procfile and was able to build/run locally. However, Heroku was unable to detect the web process.


web:	java -cp target/classes:target/dependency/* com.helloworld.HerokuTester.Tester

Java main():


Thanks again for the awesome post. I am looking at utilizing this as a template for my Vaadin + Heroku projects.


Thanks again,


Hi Clay,

Sorry for the late answer, just saw your post.

If you want to test your Procfile locally, install ruby if it’s not there yet, then

gem install foreman

Then you can run “foreman start” where your Procfile is.

Also, to run on Heroku, you shouldn’t specify the port yourself. Heroku, and foreman, provide the port to use in the PORT system property.
Heroku does not allow to use any other port than the one provided.

After making a few small applications, I ended up rolling out my customized embed for vaadin as a maven artifact available from maven central.

It’s called vaadin-for-heroku.

I’ve made a blog post explaining what it does and how to use it:
Deploy a Vaadin application on Heroku
And the code is
available on github

Hi Nicolas,

Thank you for the excellent tutorial, thanks to you I was able to deploy my app.
I am only having one issue. After having pushed my app to Heroku, I run
heroku logs -t
and I see this ConnectException: Connection refused. I have searched on internet but could not find out how to solve it. My Vaadin project is on

2015-08-28T12:10:14.552820+00:00 app[web.1]
: Connection refused

2015-08-28T12:10:14.552927+00:00 app[web.1]
: at Method)

2015-08-28T12:10:14.553058+00:00 app[web.1]
: at

2015-08-28T12:10:14.553198+00:00 app[web.1]
: at net.spy.memcached.MemcachedConnection.handleIO(

2015-08-28T12:10:14.553348+00:00 app[web.1]
: at net.spy.memcached.MemcachedConnection.handleIO(

2015-08-28T12:10:14.554002+00:00 app[web.1]
: 2015-08-28 12:10:14.552 WARN net.spy.memcached.MemcachedConnection: Closing, and reopening {QA sa=localhost/, #Rops=0, #Wops=48, #iq=0, topRop=null, topWop=Cmd: 1 Opaque: 1 Key: 29F675258D35DC2450A240989666E7A5 Cas: 0 Exp: 3600 Flags: 2048 Data Length: 4711, toWrite=0, interested=0}, attempt 79.

2015-08-28T12:10:14.553473+00:00 app[web.1]
: at

2015-08-28T12:10:44.585258+00:00 app[web.1]
: 2015-08-28 12:10:44.583 INFO net.spy.memcached.MemcachedConnection: Reconnecting {QA sa=localhost/, #Rops=0, #Wops=48, #iq=0, topRop=null, topWop=Cmd: 1 Opaque: 1 Key: 29F675258D35DC2450A240989666E7A5 Cas: 0 Exp: 3600 Flags: 2048 Data Length: 4711, toWrite=0, interested=0}
[/code]My class has only the main method:

public static void main(final String args) {



[/code]Could you help me, please?

I recently took a look at Heroku deployment for my add-on online demo. I managed to do it relatively easily with a GitHub autodeploy and a Procfile with some changes to my main pom.xml . You can see my functioning example at
and the live demo at

Any chance you could write a small guide or record a video?

Hello Teemu Suo-Anttila,

Could you please tell me how you managed to get it work with Heroku?

What kind of change was needed regarding ProcFile,…,…

Many thanks

i try vaadin and no success on heroku i want too know what is your whole configuration

My Vaadin 14 add-demo works just fine with having

a) Having jetty-runner.jar install in pom.xml


and b) a Procfile with web process definition

web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.war

Martin Vysny created a nice example how to run V14 app in Heroku.

Our team has also published an updated tutorial for Vaadin 14. You could check it at