You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

hosty

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hosty

A code based opinionated way to self-host and manage web apps.

0.0.1-alpha.16
latest
Source
npmnpm
Version published
Maintainers
0
Created
Source

Hosty

A code based opinionated way to self-host and manage web apps.

Quick Example

import {app, db, deploy, run} from 'hosty'

// 1. Specify what you want to deploy

// A postgres database
const database = db.postgres({
  name: 'my-db',
  user: 'db_user',
  pass: 'db_pass'
})

// An application from a Git repo
const api = app.git({
  name: 'my-api',
  repo: 'https://url-to-my-repo.git',
  branch: 'main',
  domain: 'my-api-domain.com',
  env: {
    PORT: '80',
    DB_HOST: database.host,
    DB_USER: database.user,
    DB_PASS: database.pass,
    DB_NAME: database.name,
  },
})

// 2. Specify where you want deploy
const myVPS = server({
  name: '188.114.97.6' // hostname or IP
})

// 3. Deploy
deploy(myVPS, database, api)
run()

This code will do the following:

  • Connect to your server via SSH
  • Create the postgres database
  • Clone your repo, build and run it
  • Configure the domain with https support

Requirements

On local machine:

  • Ansible (tested with v2.16.6)
  • Nodejs (tested with v22.8)

On the server

  • A Linux server that uses apt and systemctl (tested on Ubuntu 22.04)
  • A user with sudo ability (using the root user is not recommended)

The detailed documentation is coming soon ...

Keywords

self-hosting

FAQs

Package last updated on 18 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts