
Ask HN: What's the best way in 2018 to distribute a self-host web application? - macca321
If I was to launch a SAAS product with a self-host option, what would be the best way to distribute it to customers?<p>Examples of things I&#x27;m concerned about are ease of installation, ease of deploying updates, ease of scaling for customers...
======
alain_gilbert
If your web app is not too complex.

I really like to build self contained binary in Go.

All the code compile to a single binary file without any external
dependencies. I put all my static files (html, css, js, imgs) inside this
binary file using "bindata". If I really need a database, I'll use sqlite as a
default (this could be configured to something else).

For updates, if you do not compress the binary file (upx), you can make a
binary patch with "bsdiff"/"bspatch"
([http://www.daemonology.net/bsdiff/](http://www.daemonology.net/bsdiff/)).
There is a Go library to do it dynamically
[https://github.com/kr/binarydist](https://github.com/kr/binarydist). So your
app could be 50Mb, but updating it would be as simple as downloading a 400Kb
patch and applying it (software can do it).

For schema migration, I like [https://github.com/rubenv/sql-
migrate](https://github.com/rubenv/sql-migrate) which can be used as a
library. Therefore, the migration can be part of the binary patch in an
update.

So in the end, you only distribute a native executable file for whatever
platform your customer is using.

------
open-source-ux
I asked a similar question on two occasions:

[https://news.ycombinator.com/item?id=16250959](https://news.ycombinator.com/item?id=16250959)

[https://news.ycombinator.com/item?id=14781420](https://news.ycombinator.com/item?id=14781420)

The short answer is that no, there is no simple way to get users to self-host
your software. Perhaps developers prefer it that way? It certainly helps keep
the SaaS model going.

Remember that what a developer deems 'simple' matches no known definition of
the word amongst ordinary users.

------
uptown
Take a look at how Koken handles their install routine. I found it very clean.
You place a file in the root of your server, then load this in a browser. It
checks permissions and technical requirements, then proceeds with the full
download and installation if everything checks-out.

[http://koken.me/](http://koken.me/)

Updates are handled similarly -- the software alerts the admin to an available
update within the admin console, and you can choose when to download and apply
the patch.

------
mgliwka
[https://www.packer.io/](https://www.packer.io/) \- allows you to create
images for a lot of platforms.

------
swanson
[https://devcenter.heroku.com/articles/heroku-
button](https://devcenter.heroku.com/articles/heroku-button) is pretty good if
you can "Heroku-ize" the product. Easy installation, updates, scaling for
sure.

------
awaywopassd
Perhaps build Docker images??

~~~
awaywopassd
I am assuming anyone who is going to self-host will be able to use Docker.
Perhaps will need to look up some documentation. But maybe I am missing
something, why would it not be good way to distribute SaaS app?

~~~
seektable
Your suggestion makes sense, and docker images + docker compose config maybe
simplest way to provide self-hosted option for web app that is already exist
as cloud service. We used this approach to enable self-hosted option for our
BI tool (SeekTable), and it works perfect for us.

------
z3
use Amazon's AWS, Google Cloud, Microsoft Azure or DigitalOcean you can run
one or more instance and pay per use. it is easy to scale if you need.

other option is some cheep VPS hosting (~50$/y) but later you maybe need to
migrate everything.

~~~
macca321
Sorry if I wasn't clear - I want to know how best to give software to others,
so they can install it on their own machines.

