Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Installing and running the MTGA Server on Linux and Windows

king edited this page Jan 2, 2023 · 1 revision

This guide will show you how to install and run the MTGA Server with NodeJS on both Linux and Windows

  • if you dont understand something please DM Pixel#5096 on Discord about what you have issues with

((for *NIX users)) commands are often preceeded with a $ or a #, a # indicates that the command should be ran as root (with sudo), $ indicates it should be ran as a normal user

((for *NIX users))

1. Installing NodeJS


For 32 Bit Windows user download and run

NodeJS v18.7.0 32-bit Download

after it is installed restart your system

For 64 Bit Windows user download and run

NodeJS v18.7.0 64-bit Download

after it is installed restart your system

For Arch Linux and it's derivatives

install the nvm Arch User Repository package

add source /usr/share/nvm/init-nvm.sh to the end of your rc file (usually ~/.bashrc or ~/.zshrc you can find out which shell you are using with $ echo $SHELL)

after it is installed restart the shell with $ $SHELL

once that is done use nvm to install v18.7.0 $ nvm install 18.7.0

Ubuntu and it's derivatives

install the nodejs package using # apt install nodejs

or install the node snap package

Debian and and it's derivatives (except for the Ubuntu family)

run # curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - &&\

run # apt-get install -y nodejs

after it is installed restart the shell with $ $SHELL

Fedora and it's derivatives

install nodejs v18 with # dnf install nodejs

after it is installed restart the shell with $ $SHELL

FreeBSD

Install the node package with pkg install node

OpenBSD

Install the node package pkg_add node

2. Installing the server

First. Open a terminal emulator the following are valid options

Window's terminal

  • Command Prompt
  • Powershell
  • Command Terminal
  • vscode

Common Linux terminal emulator

  • Konsole
  • Alacritty
  • Xterm
  • rxvt
  • Yakuake
  • xfce4-terminal
  • Gnome Terminal

then download the MTGA server's source code as a zip file and store it somewhere

On Windows

Navigate to the server's source code directory

and run $ npm install

With VS Code on Windows

open the server folder in vscode by right-clicking on folder and open with vscode image

Toggle Terminal and enter npm install

On Arch Linux

tell the system to use the correct version of nodejs $ nvm use 18.7.0

Navigate to the server's source code directory

and run npm install

On other *NIX systems

Your system might be configured to use another NodeJS version by default, please refer to your distribution's documentation on how to change the default version or refer to online help

Navigate to the server's source code directory

and run npm install

3. Running the server

Again with your preferred terminal emulator (refer to step 2's unordered lists )

Navigate to the server's directory (*NIX/Windows)

NOTE : the server's default port is 443 on most systems that might require you to launch the server as an administrator/with root privileges, it might be wise to change the port if you do not have access to the admin/root account

Windows's Command Prompt

run npm start if that does not work use node ./

Windows's Powershell and *NIX

run $ node ./

Using VSCode on Windows

In the Terminal, enter npm start, and wait for the Server is listening at *** prompt

CTRL + Left-click the IP address shown to open the Web-based Launcher

image

Troubleshooting

Windows

Cannot find module ..npm-cli.js

If you get the Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' error at anytime, re-install NodeJS (see Step 1)