How to deploy my wasp project to a purchased basic server?

Let's say I bought a hosting service from GoDaddy, will I be able to upload my website after "wasp build"?
5 Replies
kapa.ai
kapa.ai3mo ago
Hi @skyblade2954. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, you can deploy your Wasp project to a purchased server, as long as the server supports Wasp's build format. Here are the general steps you need to follow: 1. Generate Deployable Code: Run the command wasp build to generate deployable code for the whole app in the .wasp/build/ directory. Note that you won't be able to build the app if you are using SQLite as a database. You'll have to switch to PostgreSQL before deploying to production.
wasp build
wasp build
Source (https://wasp-lang.dev/docs/advanced/deployment/manually#deploying-a-wasp-app) 2. Deploy the API Server (backend): There's a Dockerfile that defines an image for building the server in the .wasp/build directory. To run the server in production, deploy this Docker image to your hosting provider and ensure the required environment variables on the provider are correctly set up. The mechanism of setting these up is specific per provider. Source (https://wasp-lang.dev/docs/advanced/deployment/manually#deploying-a-wasp-app) 3. Deploy the Web Client (frontend): To build the web app, position yourself in .wasp/build/web-app directory and run the following commands:
cd .wasp/build/web-app
npm install && REACT_APP_API_URL=<url_to_wasp_backend> npm run build
cd .wasp/build/web-app
npm install && REACT_APP_API_URL=<url_to_wasp_backend> npm run build
Replace <url_to_wasp_backend> with the URL of the Wasp server that you previously deployed. This will build the web client and put it in the build/ directory in the web-app directory. Since the app's frontend is just a bunch of static files, you can deploy it to any static hosting provider. Source (https://wasp-lang.dev/docs/advanced/deployment/manually#3-deploying-the-web-client-frontend) 4. Deploy a PostgreSQL database and keep it running: This step will depend on the specific hosting provider you are using. You will need to set up a PostgreSQL database on your server and ensure it is running. Remember, if you make updates and need to redeploy, you will need to run wasp build to rebuild your app and repeat the deployment steps. Source (https://wasp-lang.dev/docs/advanced/deployment/manually#updates--redeploying) Please note that the specifics of these steps can vary depending on your hosting provider. If your provider isn't listed in the Wasp documentation, it just means there isn't a step-by-step guide available yet. You may need to refer to your hosting provider's documentation for specific instructions on deploying Docker images and static files. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @skyblade2954, 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?
miho
miho3mo ago
It depends what the server offer, does it offer Node.js hosting? Generally, those kind of shared hosting websites don't offer you much in terms of access to the raw server and you are stuck with whatever they setup for you. Link us the hosting you want to buy and we'll probably we able to tell you if Wasp could be hosted there.
skyblade2954
skyblade29543mo ago
What should I check? @miho Node.js hosting is the most important thing? Could you please tell me a good cheap hosting service for wasp?
MEE6
MEE63mo ago
Wohooo @skyblade2954, you just became a Waspeteer level 3!
skyblade2954
skyblade29543mo ago
Like GoDaddy?
Want results from more Discord servers?
Add your server