I work at FlowiseAI. We build open-source, self-hostable software (flowiseai.com). I'm also building a product that will eventually be self-hostable.
Most of Flowise's users are self-hosting it for free. They use our public docker image. Most of our code is Apache licensed (but you can also choose something like AGPL which is common in commercial open-source software). Part of our codebase contains code that has a commercial license (basically saying they can't sell this as a service/compete with us). This is assuming you want to open-source it.
Or you could go the 37Signal's Once philosophy - make source available for a one-time fee. Check out once.com.
You could also just keep your code private but publish a public docker image, have users purchase a license on your website, and make your software only work with a valid license.
So you offer a SaaS that you charge for, but users can also self-host it for free. Did I get that right?
As for 37signals’ Once philosophy, I built #telebugs exactly along those lines :)
Regarding keeping the code private while publishing a Docker image - that won’t really work with interpreted languages, since the code can easily be extracted from the image.
Yep. That's right.