
Template details
astro-deno-starter
Starter kit for Astro with a custom Deno server, full request access, and restructured project layout.
About this template
astro-deno-starter is a boilerplate that pairs the Astro static site framework with a Deno server, giving developers a custom server with full request access while keeping Astro files isolated in an astro directory.
What is astro-deno-starter?
astro-deno-starter is a GitHub repository that provides a starter kit for building Astro projects on the Deno runtime. Its core function is to let you execute your own Deno server instead of relying on Astro's built-in static output, which means you have access to the full request object and can handle dynamic behavior beyond static pages. The project reorganizes the standard Astro layout: all Astro files and npm-related configuration live in an astro subfolder, while the pages directory is hoisted out to the project root. It includes a set of deno.json task scripts that manage the development and build workflow. The repository is publicly hosted on GitHub and currently has 7 stars.
What makes astro-deno-starter stand out?
- Custom Deno server — You run your own server instead of using Astro's default, giving full access to the incoming request object for dynamic handling.
- Isolated Astro directory — All Astro files and npm dependencies are contained in an
astro/folder, keeping the project root focused on your Deno server code. - Hoisted pages directory — The
pagesfolder is moved out of the Astro directory to the root level, making it easier to locate and edit routes. deno.jsontask scripts — Predefined Deno tasks for the common commands:dev,build,start, andyarn.- Combined dev command —
deno task devboots both the Astro dev server and the Deno server simultaneously with file watching for live updates. - Production workflow — Run
deno task buildto build the Astro site, thendeno task startto serve it in production with your Deno server. - Adjusted
.gitignore— The ignore rules are modified to include theastro-distbuild files in the source repo so the Deno server can access and serve them.
Who should use astro-deno-starter?
Developers who already use or want to use Deno as their runtime and prefer to write a custom server rather than depend on a platform adapter can use this starter as a base for an Astro project. It's also useful for anyone who needs full request-level access to implement middleware, API routes, or server-side logic. Finally, developers who like a project structure where Astro's tooling is tucked into a subdirectory and pages live at the top level will find this layout helpful.
What can you do with astro-deno-starter?
- Build a dynamic Astro site — Because you control the Deno server, you can handle requests conditionally, add custom headers, or implement server-only endpoints alongside static Astro pages.
- Develop with simultaneous watchers —
deno task devruns both Astro's dev server and your Deno server at once, so you can edit pages and server code with live reload. - Package and deploy a production build — Use
deno task buildto compile the Astro site anddeno task startto run it with Deno in a production environment.
How does astro-deno-starter work?
After cloning the repository, you run deno task yarn to install the npm dependencies for Astro. During development, deno task dev starts both astro dev and the Deno server with file watching. When you're ready to go live, deno task build compiles the Astro output, and deno task start boots your Deno server to serve the built files.
Alternatives
The default Astro starter for Deno is the baseline that this project aims to improve on. Instead of using that starter's approach, astro-deno-starter gives you a hand-written Deno server with full request access and a different directory layout. That's the main alternative worth comparing against.
FAQ
Is astro-deno-starter free?
Yes, the repository is publicly hosted on GitHub, so the code is freely available for anyone to view, fork, and use in their own projects.
What does deno task dev do?
It starts both the Astro development server and the Deno server concurrently, with file watching enabled so changes to your Astro pages or Deno server code trigger automatic reloads.
How do I install Astro's npm dependencies?
Run deno task yarn from the project root. This invokes the Deno task that installs the Astro npm dependencies, keeping them separate from your Deno tooling.
How is this different from the default Astro starter?
This starter runs a custom Deno server that gives you full access to the request object, stores all Astro files in an astro/ folder, and moves the pages directory to the project root. The default starter does not expose the request in the same way.















