systemctl start wasp.service
i'm trying to get the wasp website and db to auto start on the server.
this is my wasp.service file. i'm not sure what's needed
[Unit]
Description=Wasp Web Site
After=network.target
[Service]
Type=simple
User=johne5
Group=johne5
WorkingDirectory=/home/johne5/website/app
ExecStart=/usr/bin/wasp start
[Install]
WantedBy=multi-user.target
2 Replies
Hi @johne5. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I apologize, but the knowledge sources provided do not contain specific information about setting up a systemd service file for Wasp or auto-starting Wasp on a server. The documentation and discussions available focus more on development setup, CLI usage, and deployment options, but don't cover the specific scenario you're asking about.
However, I can provide some general guidance based on the Wasp documentation:
1. The
wasp start
command is typically used for development purposes, as mentioned in the CLI Reference. It's not recommended for production use.
2. For production deployment, Wasp recommends using the wasp build
command to generate a production-ready build, and then deploying that build. You can find more information about deployment in the Deployment documentation.
3. If you're trying to set up a production environment, you might want to consider using Wasp's deployment features or following their manual deployment guidelines instead of creating a systemd service.
If you still want to proceed with a systemd service, you might need to adjust your approach. Consider building your Wasp app first and then creating a service to run the built application. However, the exact steps for this are not provided in the given knowledge sources.
For the most accurate and up-to-date information on running Wasp in a production environment, I recommend reaching out to the Wasp community on their Discord channel or consulting their latest documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @johne5, 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?We don't recommend using
wasp start
for deployment at all becuase it uses Vite's dev server and nodemon
which restarts your server on file changes. It's not really production-ready. Ideally, you'd build your app with wasp build
and deploy the client and the server apps in some way.
We have a guide on hosting Wasp on a VPS in the upcoming docs here: https://wasp-docs-on-main.pages.dev/docs/deployment/deployment-methods/self-hosted#simple-setupSelf-Hosted | Wasp
If you have your server or rent out a server, you can self-host your Wasp apps. Self-hosting your apps gives you full control over your apps and their data. It can be more cost-effective than a cloud provider since you can deploy multiple apps on a single server. However, you'll need to manage the server yourself, which can be time-consuming and...