How to Create a Svelte & Firebase Project

This page explains how to create a Svelte project hosted on Firebase. The following steps were done with these versions:

Create a GitHub Repository

Go to your GitHub account. Log in or create an account if you don’t already have one. Create a new repository. You will be asked for:

Then go to Settings and add collaborators if needed.

On the repository page, there is a <> Code button that allows you to copy the SSH link of the repo. Open a terminal in the folder where you want to create your project and clone the repo:

git clone git@github.com:UserName/Repository

If necessary, you can specify user information for this specific project:

git config --local user.name "Your Name"
git config --local user.email "you@example.com"

Create a SvelteKit Project

The following command creates the SvelteKit project. It will generate a project with the specified name. If you want your GitHub repo to contain the project directly, run this command from the parent folder; otherwise, a subfolder will be created for the Svelte project:

npx sv create projectname

Once the Svelte project is created, move into the project folder and start your local development server:

cd projectname/
npm run dev -- --open

If everything worked correctly, the site should open in your browser with a welcome message.

Firebase

Go to the Firebase console and create a new project.

In the creation menu, choose App Hosting and click Get Started. Fill in the required fields and validate. Firebase will perform an initial deployment from the GitHub repository. After this deployment, your hosting should be ready! Click on the Firebase domain link that was created — you should now access your hosted site.

You can also deploy from the command line. To do this, install the Firebase tools:

npm install -g firebase-tools

Log in to your Google account:

firebase login

Configure Firebase in your project:

firebase init

Choose App Hosting Setup to link your hosting, and fill in the required fields.

Once the setup is finished, you can deploy using:

firebase deploy

And that’s it!

See also


Last update : 11/26/2025