anjanesh we don't have an installer for Deno yet but you can install it manually on an AlmaLinux 9 server like so:
- Create a new Nginx Proxy Port app, making a note of its port assignment.
- Add the new app to a site.
- Log in to SSH as the app's shell user.
- Run the following command to install Deno into your home directory:
curl -fsSL https://deno.land/install.sh | sh
- Follow the prompts to complete the Deno installation.
- Run the following commands to create a new Deno project:
cd ~/apps/name_of_app
deno init myproject
cd myproject
- Edit main.ts in the project directory to run a basic http server listening on your port assignment, like this (replace 55555 with your port):
Deno.serve({port: 55555}, (_req) => {
return new Response("Hello, World!");
});
- Run the script as a background process with the following command, replacing the app name with your own:
daemonize -c ~/apps/myapp/myproject -a -o ~/logs/apps/myapp/deno.log -e ~/logs/apps/myapp/deno.log -p ~/logs/apps/myapp/deno.pid ~/.deno/bin/deno run --allow-net main.ts
At that point the app will be running, serving the site you created in step 2.
You can stop the process by running:
kill $( cat ~/logs/apps/myapp/deno.pid )