Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Latest commit

 

History

History
63 lines (48 loc) · 2.05 KB

Linux.md

File metadata and controls

63 lines (48 loc) · 2.05 KB

Unpack the zip file in a suitable location, and then open the unpacked folder. Open a terminal window in this location and run the command: node resources/app/main.js

You should now see a message saying VTT is running.

Closing the terminal will stop the application. If you want to run the server for a long period of time even after the terminal is closed, or the server might close unintentionally after starting, daemon tools such as forever could be used.

Installation of forever

$ [sudo] npm install forever -g

Configure daemon running

$ forever [-l forever.log] [-a] path/to/foundryvtt/resources/app/main.js --dataPath=path/to/foundrydata

For a server that runs without the need for a terminal or that restarts automatically at boot up, you should leverage a tool such as systemd or upstart.

Example systemd unit

[Unit]
Description=Foundry VTT
After=network.target

[Service]
User=%i
ExecStart=node /path/to/foundryvtt/resources/app/main.js
Restart=on-failure

[Install]
WantedBy=multi-user.target

Running

sudo systemctl start [email protected]

sudo systemctl enable [email protected]

Example nginx config with certbot

    server {
        listen 443 ssl;
        listen [::]:443 ssl;
        server_name foundry.example.com;

        location / {
            proxy_pass http://localhost:30000;
            proxy_intercept_errors on;
            proxy_set_header Host            $host;
            proxy_set_header X-Real-IP       $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;

            # required for websockets to work
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }

After running certbot, certbot will modify your nginx config file to add ssl certs and optionally an http->https redirect