Been there, done that.
I don't believe the company will be able to survive
This is an important consideration. What rational reason is there to work for a company if you cannot convince yourself that it will succeed? If you don't believe the business can succeed, the thing to consider is this:
Would you rather start looking for a different job now, or wait until you have no other choice?
At some startups, the founders will be quite transparent about the operational status of the business, giving you visibility into things like how much cash is on hand, what the burn rate is, how long the company can keep operating without additional revenue, and how likely it is that they will find that additional revenue in the near future. However, I'm not really hearing that you've been given that sort of visibility.
I've been with startups where the founders themselves advised everyone to start applying for other jobs because there was only a couple months of cash left and few prospects for finding more. And I've been with startups where the founders kept everyone in the dark about the actual state of the business, to the point of telling employees that the company had "plenty of cash" right up until the day they shut down the business.
I don't know your exact position, but it sounds like you may be more in the latter situation than you are in the former. So if nothing else, be wary.
In conjunction with this, the founder's behaviour is becoming more and
more autocratic, and they are making increasingly rash and impulsive
business decisions which don't make any sense to the staff, with
morale rapidly draining out of the organisation as a result.
Those are valid concerns with any business. So it brings up another question:
What would you do if the company was not a startup but everything else was still the same?
If you'd not stay with a larger company that had these issues, there's no reason to stay with a smaller one.
It's normal to feel a degree of responsibility for a startup's outcome. But when the founder of a startup acts as you describe, makes bad business decisions, and ignores the advice of other stakeholders, whatever happens is entirely on them. There's likely nothing you can do to change the outcome, no matter how much you may want to.
another part of me worries that it'll have a domino effect , because I
know practically everyone is unhappy at how the business is being run
If that happens, it's not your fault. If "practically everyone" is already unhappy with the direction of the business, that can't possibly be related to you leaving in the future. Your concern is commendable, but somewhat misplaced.
You can only be responsible for your own actions. If other people decide to leave, that's entirely up to them. And if you decide to stay, you may well find that your "domino effect" happens anyways. If morale is as low as you say, it likely will.
You may also want to consider the possibility that with morale as low as it is, many of your colleagues might actually be happier with a different employer anyways.
the team is so tiny means that each developer is gatekeeper to several
important features, and it'll be an unwanted distraction for the
company to deal with when replacing me, if they decide to do so. The
cash situation means that they may not, however.
That's just how business goes. And even a startup can and should take measures to mitigate the impact of losing a key staff member. If yours has not, that's another thing that isn't your fault.
What you can do, however, is take measures to mitigate the impact of your departure. For instance by ensuring that you thoroughly document everything that you're the gatekeeper of (on a wiki, for instance) and working to spread the knowledge around to other team members. This is something that should be done regardless, as a matter of sound business policy.
Am I doing the right thing here?
It's impossible to say. There's not really any clear "right" or "wrong" here.
You're unhappy with your job and concerned about the company's future prospects. That's as valid a reason to seek other opportunities as any.
And you're at a startup, and concerned over the potential impact your departure will have. That's a normal reaction to this kind of situation.
So there's two competing influences, neither of which is unreasonable. At the end of the day, you just have to make your own decisions based upon your own thoughts, feelings, and sense of ethics. It's not wrong to leave or right to stay, or vice versa. Each approach has its own pros and cons, risks and rewards. You need to weigh those up, and choose what is right for you.
I'd suggest that you not place too much weight upon the indirect impact your decision may have upon the future of the startup or your colleagues, but I certainly can't say it would be wrong of you to do so.