DEV Community

Matthias Andrasch
Matthias Andrasch

Posted on

Hosting SvelteKit as SSR on mittwald SpaceServer

The green webhosting company mittwald (Germany) launched two new products with support for NodeJS Server Side Rendering (SSR):

The mittwald SpaceServer and the mittwald proSpace.

Screenshot mittwald product configurator

The SpaceServer can be tested freely for 10 days.

For testing I used the official SvelteKit demo application npm create svelte@latest my-app and switched to SvelteKits adapter-node.

The sverdle subpage demonstrates the benefits of SSR - the solution of the quiz is handled securely on server side (+page.server.js).

Image description

Here are some impressions:

Create a new project

Image description

Create an app within this project

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Test domains

All projects have automatically a subdomain assigned:

Image description

Monitoring the server load

Image description

Start and stop via SSH

Image description

Important information: I ran into some minor issues because I had my SSH session open and edited the app configuration in the web dashboard at the same time. Currently you need to exit the SSH session after changes so that the currently running app instance can be shutdown. I ended up having multiple SvelteKit apps online on the same port competing for serving the first request (and generating random 404 / 502 errors). ;-) But this will be improved in future according to mittwalds very helpful support team.

Conclusion

I really enjoyed working with the mStudio dashboard and the SpaceServer!

SSH keys can be assigned per project (or globally per member of the space server) and external domains can be connected for free (including free SSL certificates). There is also a support chat where you can directly get in touch with the Mittwald support team.

For personal hobby projects, the starting price of 35โ‚ฌ/month for the SpaceServer is of course a bit much. But for freelancers or agencies a fixed price managed server which also can be scaled up or down is a great deal in my opinion. The proSpace is also an interesting deal for bigger sized projects and requirements.

There is also the AgenturServer product where NodeJS can be added for 9โ‚ฌ/month to individually scalable projects.

Congrats to mittwald for introducing this awesome product! ๐Ÿ‘๐Ÿ‘๐Ÿ‘ It is so amazing to finally see a comfortable and easy NodeJS SSR hosting offer in the EU with full GDPR-compliance. ๐Ÿ‡ช๐Ÿ‡บ mittwald is also verified by the Green Web Directory. ๐ŸŒฑ

I really hope that other webhosting companies will follow and that NodeJS SSR will be easily available for more developers in future!

Technical notes regarding SvelteKits adapter-node

The default start command for adapter-node is node build. Beware: For adapter-node usage you will need to transfer some more project files, not only the build/-folder. See adapter-node docs for more information. Some files in node_modules/ are needed as well.

I originally tried using rsync via GitHub action, but couldn't figure out how to optimize the node_module dependencies. See my demo repo https://github.com/mandrasch/sveltekit-mittwald-spaceserver-demo. This is entirely a GitHub Action problem / challenge, not a problem of the SpaceServer. For now I would rather suggest starting with git clone ... and npm install && npm run build on the server (and trigger these commands via GitHub Action and SSH). To be continued ... ๐Ÿค”

Top comments (0)