W
Wasp•4w ago
Snowdevil

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:
[2025-03-11 00:47:19] /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: cat: command not found
[2025-03-11 00:47:19] /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: / 1048576: syntax error: operand expected (error token is "/ 1048576")
[2025-03-11 00:47:20] /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
[2025-03-11 00:47:20] /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
[2025-03-11 00:47:20] /cnb/lifecycle/launcher: line 4: exec: bash: not found
[2025-03-11 00:47:19] /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: cat: command not found
[2025-03-11 00:47:19] /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: / 1048576: syntax error: operand expected (error token is "/ 1048576")
[2025-03-11 00:47:20] /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
[2025-03-11 00:47:20] /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
[2025-03-11 00:47:20] /cnb/lifecycle/launcher: line 4: exec: bash: not found
32 Replies
kapa.ai
kapa.ai•4w ago
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?
Snowdevil
SnowdevilOP•4w ago
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.
Filip
Filip•4w ago
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 sec
Snowdevil
SnowdevilOP•4w ago
I 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.
Filip
Filip•4w ago
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
Snowdevil
SnowdevilOP•4w ago
It would just throw a generic error saying it couldn't connect to the database when running wasp start locally
MEE6
MEE6•4w ago
Wohooo @Snowdevil, you just became a Waspeteer level 1!
Filip
Filip•4w ago
I recommend trying to connect to the database using that connection string manually, outside of wasp to verify that it's truly accessible
I recommend this as the next step then That's my guess for where the problem is
Snowdevil
SnowdevilOP•4w ago
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
Filip
Filip•4w ago
Haha, yeah, I know the feeling
Snowdevil
SnowdevilOP•4w ago
Your probably right, my first time setting up a host. I've only ever done local development
Filip
Filip•4w ago
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
Snowdevil
SnowdevilOP•4w ago
I appreciate it! I'll check back tonight with good or bad news xD
Omen
Omen•4w ago
Im having similar issue with connecting to external database. My connection string is active and accepting connections but the project cannot run
MEE6
MEE6•4w ago
Wohooo @Omen, you just became a Waspeteer level 1!
Snowdevil
SnowdevilOP•4w ago
With digital ocean as well?
Snowdevil
SnowdevilOP•4w ago
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
Lightshot
Screenshot
Captured with Lightshot
Snowdevil
SnowdevilOP•4w ago
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.
[ Client ] VITE v6.2.1 ready in 505 ms
[ Client ]
[ Client ] ➜ Local: http://localhost:3000/
[ Client ] ➜ Network: http://172.28.19.131:3000/
[ Client ] ➜ press h + enter to show help
[ Server ]
[ Server ] > server@0.0.0 start
[ Server ] > node --enable-source-maps -r dotenv/config bundle/server.js
[ Server ]
[ Server ] 🚀 "Email and password" auth initialized
[ Server ] Starting pg-boss...
[ Server!] pg-boss failed to start!
[ Server!] Error: self-signed certificate in certificate chain
[ Server!] at /home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/node_modules/pg-pool/index.js:45:11
[ Server!] at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
[ Server!] at async Db.executeSql (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/node_modules/pg-boss/src/db.js:28:14)
[ Server!] at async Contractor.isInstalled (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/node_modules/pg-boss/src/contractor.js:32:20)
[ Server!] at async Contractor.start (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/node_modules/pg-boss/src/contractor.js:37:23)
[ Server!] at async PgBoss.start (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/node_modules/pg-boss/src/index.js:103:5)
[ Client ] VITE v6.2.1 ready in 505 ms
[ Client ]
[ Client ] ➜ Local: http://localhost:3000/
[ Client ] ➜ Network: http://172.28.19.131:3000/
[ Client ] ➜ press h + enter to show help
[ Server ]
[ Server ] > server@0.0.0 start
[ Server ] > node --enable-source-maps -r dotenv/config bundle/server.js
[ Server ]
[ Server ] 🚀 "Email and password" auth initialized
[ Server ] Starting pg-boss...
[ Server!] pg-boss failed to start!
[ Server!] Error: self-signed certificate in certificate chain
[ Server!] at /home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/node_modules/pg-pool/index.js:45:11
[ Server!] at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
[ Server!] at async Db.executeSql (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/node_modules/pg-boss/src/db.js:28:14)
[ Server!] at async Contractor.isInstalled (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/node_modules/pg-boss/src/contractor.js:32:20)
[ Server!] at async Contractor.start (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/node_modules/pg-boss/src/contractor.js:37:23)
[ Server!] at async PgBoss.start (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/node_modules/pg-boss/src/index.js:103:5)
[ Server!] at async startPgBoss (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js:54:9)
[ Server!] at async startServer (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/.wasp/out/server/src/server.ts:14:3) {
[ Server!] code: 'SELF_SIGNED_CERT_IN_CHAIN'
[ Server!] }
[ Server ] Server listening on port 3001
[ Server!] node:internal/process/promises:392
[ Server!] new UnhandledPromiseRejection(reason);
[ Server!] ^
[ Server!]
[ Server!] UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<PgBoss>".
[ Server!] at throwUnhandledRejectionsMode (node:internal/process/promises:392:7)
[ Server!] at processPromiseRejections (node:internal/process/promises:475:17)
[ Server!] at process.processTicksAndRejections (node:internal/process/task_queues:106:32) {
[ Server!] code: 'ERR_UNHANDLED_REJECTION'
[ Server!] }
[ Server!]
[ Server!] Node.js v23.9.0
[ Server ] [nodemon] app crashed - waiting for file changes before starting...^C
[ Server!] at async startPgBoss (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBoss.js:54:9)
[ Server!] at async startServer (/home/snowdevil/repo/granite-main/saas-service-booking/granite-scheduling-main/app/.wasp/out/server/src/server.ts:14:3) {
[ Server!] code: 'SELF_SIGNED_CERT_IN_CHAIN'
[ Server!] }
[ Server ] Server listening on port 3001
[ Server!] node:internal/process/promises:392
[ Server!] new UnhandledPromiseRejection(reason);
[ Server!] ^
[ Server!]
[ Server!] UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<PgBoss>".
[ Server!] at throwUnhandledRejectionsMode (node:internal/process/promises:392:7)
[ Server!] at processPromiseRejections (node:internal/process/promises:475:17)
[ Server!] at process.processTicksAndRejections (node:internal/process/task_queues:106:32) {
[ Server!] code: 'ERR_UNHANDLED_REJECTION'
[ Server!] }
[ Server!]
[ Server!] Node.js v23.9.0
[ Server ] [nodemon] app crashed - waiting for file changes before starting...^C
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.
MEE6
MEE6•4w ago
Wohooo @Snowdevil, you just became a Waspeteer level 2!
Killshot
Killshot•4w ago
are you using caddy or nginx as web server?
Snowdevil
SnowdevilOP•4w ago
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.
2025-03-12T21:28:21.946084387Z /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: cat: command not found
2025-03-12T21:28:21.950239008Z /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: / 1048576: syntax error: operand expected (error token is "/ 1048576")
2025-03-12T21:28:22.041401617Z /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
2025-03-12T21:28:22.051169816Z /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
2025-03-12T21:28:22.062458680Z /cnb/lifecycle/launcher: line 4: exec: bash: not found
2025-03-12T21:28:12.823104650Z /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: cat: command not found
2025-03-12T21:28:12.828661611Z /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: / 1048576: syntax error: operand expected (error token is "/ 1048576")
2025-03-12T21:28:12.905493539Z /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
2025-03-12T21:28:12.961860416Z /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
2025-03-12T21:28:12.992322782Z /cnb/lifecycle/launcher: line 4: exec: bash: not found
2025-03-12T21:28:21.946084387Z /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: cat: command not found
2025-03-12T21:28:21.950239008Z /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: / 1048576: syntax error: operand expected (error token is "/ 1048576")
2025-03-12T21:28:22.041401617Z /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
2025-03-12T21:28:22.051169816Z /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
2025-03-12T21:28:22.062458680Z /cnb/lifecycle/launcher: line 4: exec: bash: not found
2025-03-12T21:28:12.823104650Z /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: cat: command not found
2025-03-12T21:28:12.828661611Z /layers/heroku_nodejs/profile/profile.d/WEB_CONCURRENCY.sh: line 35: / 1048576: syntax error: operand expected (error token is "/ 1048576")
2025-03-12T21:28:12.905493539Z /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
2025-03-12T21:28:12.961860416Z /layers/heroku_nodejs/profile/profile.d/cnb_shim_symlink.sh: line 1: readlink: command not found
2025-03-12T21:28:12.992322782Z /cnb/lifecycle/launcher: line 4: exec: bash: not found
Killshot
Killshot•4w ago
I am not familiar with DO droplets. But do you have any other spare VPS that you can try this on?
Killshot
Killshot•4w ago
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.
Killshot
Killshot•4w ago
@Snowdevil
Snowdevil
SnowdevilOP•4w ago
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
Killshot
Killshot•4w ago
Yeah give it a try and lemme know what happens
Snowdevil
SnowdevilOP•4w ago
Will do, thank you!
Filip
Filip•3w ago
Hey @Snowdevil, still need help with this?
Snowdevil
SnowdevilOP•3w ago
Yeah i just haven't had the time in the past couple days to get to the pc
Filip
Filip•3w ago
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!
Killshot
Killshot•2w ago
:salute_right: Hey @Snowdevil Any update on this? Did you finally solve it?
Snowdevil
SnowdevilOP•2w ago
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 🙂

Did you find this page helpful?