#Host Astro + Solid JS on Netlify as a static site

3 messages · Page 1 of 1 (latest)

stoic forum
#

Can I statically host an Astro SSG site which has components using the island architecture and solid JS?

I.e. would I need to pay for hosting to have a server running if I use Astro with a UI framework, or could I host it for free as a static site on something like Netlify?

Thanks!

sterile echoBOT
#

Hi @stoic forum. 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 statically host an Astro site that uses the Island architecture and Solid JS on Netlify. Astro's Island architecture allows you to build interactive UI components that run in isolation from other components on the page. This architecture supports multiple UI frameworks, including Solid JS.

Astro's emphasis on minimized JavaScript usage and optimized loading times makes it ideal for static site generation. By default, your Astro project is a static site, and you don't need any extra configuration to deploy a static Astro site to Netlify.

Here's how you can deploy your Astro project to Netlify:

  1. Push your Astro project to a Git provider (like GitHub, GitLab, or Bitbucket).
  2. Create a new site on Netlify (https://app.netlify.com/start) and link the repository.
  3. Set the build command to npm run build and the publish directory to dist/.
  4. Click on Deploy site.

You can find more detailed instructions in the Astro documentation (https://docs.astro.build/en/guides/deploy/netlify#project-configuration).

Remember, even though your site uses a UI framework like Solid JS, it doesn't mean you need a server running all the time. Astro compiles your components to static HTML and CSS during the build process, and the resulting site can be hosted on any static site hosting service, like Netlify, without the need for a server.

Sources:


Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: