Skip to content

Guide · Open source

How to use Fresh: install, run and build pages with Deno

Updated · written with AI from the project's own documentation and checked against our catalogue data

Fresh is a web framework built on Deno and written in TypeScript. It is used to build websites and web apps where each file in a folder becomes a page. This guide shows you how to create a project, run it locally, understand how pages and islands work, and deploy it, so you can judge whether it fits your work.

Freshfreshframework/fresh · ★ 13.8k · MIT

Quick start

  1. 1Install the Deno CLI. Install the latest Deno CLI, which Fresh requires.
  2. 2Scaffold the project. Run deno run -Ar jsr:@fresh/init to create a new Fresh project.
  3. 3Enter the folder. Change into the fresh-project directory with cd fresh-project.
  4. 4Start the dev server. Run deno task dev and open http://localhost:5173 in your browser.
  5. 5Edit and watch changes. Change files in the project and see the updates reflected in the browser.
  6. 6Deploy. Push to GitHub and connect the repository to a Deno Deploy project.

What do you need before you install Fresh?

Fresh is built around Deno, so the one prerequisite is the Deno CLI. The README asks you to install the latest version of the Deno CLI before you begin.

Fresh is a good fit if you already work with Deno or are comfortable with a JavaScript module system and a terminal. If you have never used either, expect a learning curve.

  • Install the Deno CLI (the README links to deno.com for the install)
  • Use a terminal to run the commands below

How do you scaffold a new Fresh project?

Fresh provides an init script that creates a new project for you. Run it from the terminal with the command below. The README says no configuration is necessary to get started.

Then move into the folder the script created. The README names it fresh-project.

deno run -Ar jsr:@fresh/init cd fresh-project

How do you start the development server?

From inside your project folder, start the development server with deno task. The README says you can then open http://localhost:5173 in your browser to see the page.

While the server runs, edits to the project source code appear in the browser.

deno task dev

How does file-based routing work in Fresh?

Fresh uses file-system routing, similar to Next.js. Each file in a folder becomes a page, so the file layout is your route map. The README lists this as one of its core features.

Fresh also says it sends no JavaScript to the client by default. Pages are rendered on the server, and only small interactive pieces, called islands, are hydrated in the browser.

  • Each file in a folder becomes a page
  • Pages are server-rendered by default with no client JavaScript shipped
  • Islands add interactivity only where you need it
  • TypeScript is supported out of the box

How do you deploy a Fresh project?

The README describes deploying to Deno Deploy. The steps are to push your project to GitHub, create a Deno Deploy project, and select your repository. According to the README, the project is then deployed to a public subdomain with no configuration necessary.

For a fuller walkthrough of setup, see the Getting Started page in the Fresh documentation at usefresh.dev.

  • Push your project to GitHub
  • Create a Deno Deploy project at console.deno.com
  • Select your GitHub repository

Where do you find more help and documentation?

The official documentation is at usefresh.dev/docs/introduction. The API reference is hosted on deno.land. The README also describes contributing guidelines in .github/CONTRIBUTING.md for people who want to help with the project.

What people use it for

  • Building a small marketing or documentation site with minimal setup
  • Adding interactive widgets to server-rendered pages using islands
  • Creating a web app for developers already working in Deno
  • Deploying a simple project to Deno Deploy from a GitHub repository

Frequently asked questions

Is Fresh free to use?

Fresh is released under the MIT licence, according to the repository. The MIT licence generally permits use, modification and distribution, but read the licence text for the exact terms.

What do I need to install Fresh?

The main requirement is the Deno CLI. The README asks you to install the latest version, then run the init script with deno run -Ar jsr:@fresh/init.

Does Fresh work with Node.js?

The README does not describe Node.js support. Fresh is built around Deno, so if your team depends on the Node.js ecosystem, check this before choosing it.

How is Fresh different from Next.js?

Fresh uses file-system routing similar to Next.js, but its README emphasises sending no JavaScript to the client by default and hydrating only small islands. Other frameworks often compared with it include Astro, SvelteKit and Nuxt.

Why does the dev server not open at localhost:5173?

Make sure you ran deno task dev from inside the fresh-project folder, then open http://localhost:5173 as the README describes. If the page does not load, check the terminal output for errors from the server.

Can I deploy Fresh for free?

The README describes deploying to Deno Deploy with a public subdomain and no configuration necessary. Check Deno's own site for current hosting terms, since the README does not cover pricing.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use Fresh if you already work with Deno and want a minimal-setup framework that ships little client-side JavaScript, especially for small to medium sites. Pick something else, such as Next.js, Astro or SvelteKit, if you need the Node.js ecosystem, a fully client-side single-page app, or you are new to terminals and JavaScript modules.

Install options & downloads