One droplet running web app snapshot for each customer?

Posted June 25, 2014 2.2k views

Hi guys I need some help figuring out this pattern.
I have a web application currently running on flask at

for each of my customer, I want to have a droplet from digitalocean running the copy of the flask app.

I want to consolidate them under a subdomain like

so when they go to, the ip points to their own server.

Now the problem I have is handling cases like:

  • user logs in at, needs to be logged in at
  • user logs out at, needs to be logged out at
  • how do you configure an encrypted password for a new droplet instance?
  • how do you update all customer droplets with new code?

The reason I have one user per one droplet is because they run cpu and network intensive background jobs in parallel. I don’t want them to interfere with each other.

I guess I’m trying to achieve horizontal scalability, by just cloning an instance of my original web application, instead of trying to force everyone on the same instance.

Any suggestions or feedback would be very useful.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

In order to deal with the login use case, you could use OAuth. would be the OAuth provider with the sites as consumers. Check out Flask-OAuthlib.

A different approach might be to have act as the front end for all users, but have a scalable backend. That way all of the long running, cpu and network intensive jobs will actually be running on different servers, but the user would only login to the frontend.

As for updating all customer droplets with new code, I’d suggest you look into git hooks. You could setup a git repository with a post receive hook to pushes to each server. You could also use something like Fabric to do automated deployments.

by O.S. Tezer
In this DigitalOcean article, the system administration and application deployment streamlining library "Fabric" is our subject. We will learn how to install this wonderful tool, as well as see how easy things can become by simply automating mundane management tasks that would otherwise require jumping through hoops with bash hacks and hard-to-maintain, complex scripts.