Set-up Hosting SAAS Wasp on Digital Ocean
Hey all!
I'm trying to set-up the basic Open SaaS Wasp application on Digital Ocean. I was able to get it running locally without any issues.
I got the base version running from the "Getting Started" page locally. Saved that app on GitHub. Now I want to use the GitHub repo as a source for a Digital Ocean App Platform.
I've tried many different options, but the best setup I have so far is as follows:
Environment Variable:
PATH=$PATH:/home/apps/.local/bin
Build Command:
curl -sSL https://get.wasp-lang.dev/installer.sh | sh
When I add wasp start db
to the build command, it says the docker exe cannot be found. When I add it to the run command, it throws the errors below.
Errors:
32 Replies
Hi @Snowdevil. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources provided, I don't have enough specific information to fully address your question about setting up a Wasp SAAS application on Digital Ocean. However, I can provide some general insights and suggestions based on the available information about Wasp deployment:
1. Docker requirement: Wasp typically requires Docker for running the PostgreSQL database. The error you're seeing about the docker executable not being found suggests that Docker is not available in your Digital Ocean App Platform environment. Digital Ocean App Platform may not support Docker out of the box, which could be a significant obstacle for deploying a Wasp app in this way.
2. Deployment options: The Wasp documentation doesn't seem to have specific instructions for deploying to Digital Ocean App Platform. However, there is an open issue discussing deployment to bare metal and using Docker containers, which might be more suitable for your case. Github Issue: Deployment to bare metal
3. Alternative deployment method: One community member mentioned using Caprover, a self-hosted PaaS, for deploying a Wasp application. This might be an alternative worth exploring if Digital Ocean App Platform proves challenging.
4. Database configuration: If you can't use Docker on Digital Ocean App Platform, you might need to set up a separate PostgreSQL database and configure your Wasp app to use it instead of the Docker-based development database.
5. Build and run commands: The errors you're seeing suggest that the environment doesn't have some basic Unix commands available. This might indicate that the Digital Ocean App Platform environment is quite restricted and may not be suitable for running Wasp applications as-is.
Given these challenges, you might want to consider alternative deployment strategies:
1. Use a VPS (Virtual Private Server) on Digital Ocean instead of the App Platform. This would give you more control over the environment and allow you to install Docker.
2. Explore other PaaS options that support Docker or have better compatibility with Wasp's requirements.
3. Consider deploying the frontend and backend separately, with the frontend on a static hosting service and the backend on a platform that supports Node.js applications with access to PostgreSQL.
Unfortunately, the knowledge sources don't provide a step-by-step guide for your specific use case. You might want to reach out to the Wasp community on their Discord channel for more specific guidance on deploying to Digital Ocean or alternative deployment strategies.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Snowdevil, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
The issue I believe is not being able to connect to a db. I have a managed PostGre database setup in digital ocean, and when attempting to start the app locally, it won't connect to it.
Hey @Snowdevil, if I got it right, you want to use
wasp start db
in production?
That's not supported, since wasp start db
starts an ephemeral database meant to be used only in development. It would be unsafe to use it in production
Oh, I see you've already got a managed db in digital ocean
In that case, you just need to tell your servera about it via the database url
just a secI tried doing that last part with the ENV variable for the database url, but it still isn't able to find it
I used the string parameter from the managed db which includes the url,pw,port,etc.
Check the list here: https://wasp.sh/docs/project/env-vars#wasp-server-env-vars
Yeah, that should definitely work (if the database is accessible)
What error do you get if you do that?
I recommend trying to connect to the database using that connection string manually, outside of wasp
to verify that it's truly accessible
It would just throw a generic error saying it couldn't connect to the database when running wasp start locally
Wohooo @Snowdevil, you just became a Waspeteer level 1!
I recommend trying to connect to the database using that connection string manually, outside of wasp to verify that it's truly accessibleI recommend this as the next step then That's my guess for where the problem is
Ok I can give it a shot after work. If it's not accessible, then I'm guessing i would have to work with DO on it as it would be an access issue. I've spent a few hours tinkering around with a million settings and setups last night lkl
Haha, yeah, I know the feeling
Your probably right, my first time setting up a host. I've only ever done local development
Yes - if it's inaccessible, I'd guess your connection string is wrong
If you want, you can set up a testing DB and DM me the details
and I'll try to connect
but perhaps you can figure it out yourself
Anyway, good luck!
I'm here for more help if you need it
I appreciate it! I'll check back tonight with good or bad news xD
Im having similar issue with connecting to external database. My connection string is active and accepting connections but the project cannot run
Wohooo @Omen, you just became a Waspeteer level 1!
With digital ocean as well?
It works! I just had to disable trusted sources to allow anyone to access. Now to create a new trusted source and go back to just trusted source connections and such. But at least everything runs so a foundation is officially set to build upon 🙂 Thanks for your help!
https://prnt.sc/Hj-S9pb2uEjL
I do get the error below though even though the app still runs locally. And still not able to get it running on Digital ocean to a similar issue.
It seems maybe there's something wrong with a SSL certificate
I'll dm you the database information and see if you have any luck.
Wohooo @Snowdevil, you just became a Waspeteer level 2!
are you using caddy or nginx as web server?
Digital Ocean
I think I got the connection working with the SSL stuff. But I'm noticing since the beginning of all this, even with the db stuff fixed, I'm still not able to deploy the web server on digital ocean.
When running
wasp start
in the build phase, it starts the wasp package properly, but gets stuck in the build phase when it needs to finish the build phase and move to deploy/run phase for DO.
When I run wasp start
in the deploy phase, I keep getting errors no matter what I've done so far. I think the end of the build phase in docker containerizes the build, and then I'm unable to launch any wasp commands in that build.
This is the error I get anytime I try to run any command in the deploy phase on the digital ocean server. The database is working fine, and I'm able to connect to it and migrate object model changes in the build phase.
I am not familiar with DO droplets.
But do you have any other spare VPS that you can try this on?
Also check this out.
I followed this guide to deploy wasp app on my VPS.
https://gist.github.com/infomiho/80f3f50346566e39db56c5e57fefa1fe
Gist
Deploy Wasp to a VPS (reverse proxy + Docker)
Deploy Wasp to a VPS (reverse proxy + Docker). GitHub Gist: instantly share code, notes, and snippets.
@Snowdevil
I'll see if there are any similarities with that setup and working with Digital Ocean to see if I can fix the issues I'm having. I enjoy DO a lot as it has a lot of convenient automation features built in, and scaling is easy.
Worst case scenario I suck and can't get it to work through all methods, I'll follow that with a VPS rather than the app deployment module xD
@Killshot
Yeah give it a try and lemme know what happens
Will do, thank you!
Hey @Snowdevil, still need help with this?
Yeah i just haven't had the time in the past couple days to get to the pc
Ok, I'll drop some resources
And then when you get back, feel free to ping me
I know see that @Killshot has already dropped the resource I was planning to drop 😅
Thanks @Killshot!
:salute_right:
Hey @Snowdevil
Any update on this?
Did you finally solve it?
Not yet, was busy last week with work and appointments, then wife's bday over the weekend xD
This week I don't have much going on so will be revisiting it. It's gotta work eventually and when it does we can get a gist thrown together on steps it took to do so 🙂