Skip to main content
The deno install command installs dependencies for a project or installs executable scripts globally.

Usage

# Install project dependencies
deno install

# Install specific entrypoints
deno install [ENTRYPOINTS]...

# Install globally with -g flag
deno install -g [OPTIONS] [MODULE_URL]

Local Installation

Install all dependencies

Install all dependencies from deno.json and package.json:
deno install
--lockfile-only
boolean
Only update the lockfile without installing packages

Install specific entrypoints

Cache specific modules and their dependencies:
deno install main.ts
deno install src/server.ts src/worker.ts

Global Installation

Install executable scripts globally using the -g or --global flag.
deno install -g [OPTIONS] [MODULE_URL]

Global Installation Flags

-g, --global
boolean
Install as a global executable script
-n, --name
string
Executable file name
--root
string
Installation root directory (defaults to $HOME/.deno)
-f, --force
boolean
Forcefully overwrite existing installation
--compile
boolean
Compile the script into a standalone executable

Permission flags

When installing globally, you can specify permissions that will be embedded in the installed script:
--allow-read
string
Allow file system read access
--allow-write
string
Allow file system write access
--allow-net
string
Allow network access
--allow-env
string
Allow environment access
--allow-run
string
Allow running subprocesses
--allow-sys
string
Allow access to system information
--allow-all
boolean
Allow all permissions

Examples

Local installation examples

Install all dependencies

deno install

Install with lockfile update only

deno install --lockfile-only

Install specific entrypoints

deno install main.ts
deno install src/app.ts src/cli.ts

Global installation examples

Install a script globally

deno install -g --allow-net --allow-read jsr:@std/http/file-server

Install with custom name

deno install -g -n serve --allow-net --allow-read jsr:@std/http/file-server

Install from URL

deno install -g --allow-net https://deno.land/std/http/file_server.ts

Install with all permissions

deno install -g --allow-all https://deno.land/x/deploy/deployctl.ts

Install to custom location

deno install -g --root /usr/local --allow-net my_server.ts

Force reinstall

Overwrite existing installation:
deno install -g -f --allow-net --allow-read jsr:@std/http/file-server

Install as compiled executable

Create a standalone binary:
deno install -g --compile --allow-net my_app.ts

Install with script arguments

deno install -g --allow-read my_tool.ts -- --port 8080

Installation Directory

Global installations are placed in:
  • Default: $HOME/.deno/bin
  • Custom: Specified by --root flag or DENO_INSTALL_ROOT environment variable
Make sure this directory is in your PATH:
# Add to your shell profile (.bashrc, .zshrc, etc.)
export PATH="$HOME/.deno/bin:$PATH"

Migration from Deno < 3.0

In Deno 3.0, the deno install command behavior changed:
  • Use -g flag for global installation (previously the default)
  • Script arguments now require -- separator
  • Local installation is now the default when -g is not specified
# Old (Deno < 3.0)
deno install --allow-net https://deno.land/std/http/file_server.ts arg1 arg2

# New (Deno >= 3.0)
deno install -g --allow-net https://deno.land/std/http/file_server.ts -- arg1 arg2

Build docs developers (and LLMs) love