Setting up an alt:V server with the JS module
This article will explain how to setup an alt:V server with the JS module.
Requirements
- Latest Version of NodeJS
- A Code Editor (Visual Studio Code, Sublime Text etc.)
- Basic knowledge of command prompts
- VC Redist Latest Version installed
- Windows 10+ or Linux (For running the server)
- On Linux you need the package libatomic1
apt-get install libatomic1
Summary
If you are interested in learning all of the ins and outs of getting a server setup please follow this tutorial entirely.
If you are more interested in getting a server running in a few minutes check out alt:V Quickstart repository and follow those instructions.
Obtaining the server files
Download the latest build here.
Within the Dropdown navigate to: Release, Release candidate OR Development*.
*For development, most of the time the branch release candidate is used.
Tick the following elements:
[x] Data Files
[x] JS Module
[ ] C# Module
[x] Sample Config File
[x] Example Resource Pack
Press DOWNLOAD and once you're done => Extract the .zip with your preferred program (7-Zip, Winrar, etc.)*
*Into a folder that is not on your Desktop!
Running the server
Depending on your chosen Code Editor, you may consider the following options:
Visual Studio Code
- Within VSC, open the Server Root (File > Open Folder)
- Create a new Terminal (Terminal > New Terminal )
Once you archieved to have a Terminal, it's up to you:
For PowerShell:
- Select the Prompt PowerShell
- Type > ./altv-server.exe
For Command Prompt:
- Select the Command Prompt
- Type > altv-server.exe
Congrats, your server is now running
- Press CTRL + C to stop the server.
- Press arrow up and press enter simply restart the server.
PowerShell
- Navigate to the root folder of your altv-server.exe
- Head to the adress bar of the file explorer
- Type > powershell
- Type > ./altv-server.exe
Congrats, your server is now running
- Press CTRL + C to stop the server.
- Press arrow up and press enter simply restart the server.
Command Prompt
Just run altv-server.exe
Configuring your client for development
- Navigate to your root of alt:V Client
- View
altv.toml
in your preferred editor
Now something similar to this should appear:
branch = 'rc'
build = 1182
debug = true
gtapath = 'D\\Program Files (x86)\\Steam\\steamapps\\common\\Grand Theft Auto V'
ignoreLowPriorityProps = false
lang = 'en'
lastip = ''
name = 'YourWonderfulName'
netgraph = false
streamerMode = false
voiceActivationEnabled = false
voiceActivationKey = 78
voiceEnabled = true
voiceInputSensitivity = 20
voiceVolume = 100
Using branches
Set your branch based on what you've choose in Obtaining the Server Files. Branch names:
- release
- release candidate
- dev
# Release (Mostly used):
branch = 'release'
# Release candidate:
branch = 'rc'
# Development:
branch = 'dev'
Using debug mode (client)
Edit the altv.toml
in the directory of your alt:V installation and add the following:
debug = true
This allows the usage of several debug features like reconnect etc. with your F8 console.
Configuring the server.toml
Once you're done changing the stated things above, it's time to head to the server again.
The server.toml
is where the magic happens, here you can change what is most important.
Once opened, something similar to this should appear:
name = 'alt:V Server'
host = '0.0.0.0'
port = 7788
players = 128
#password = ultra-password
announce = false
#token = YOUR_TOKEN
gamemode = 'Freeroam'
website = 'example.com'
language = 'en'
description = 'alt:V Sample Server'
modules = [ 'js-module' ]
resources = [
]
Using debug mode (server)
While you are developing make sure you ENABLE the following inside the server.toml
.
Add this to your config:
debug = true
Once enabled, you can now use several debug commands like:
restart [RESOURCE]
(server)
stop [RESOURCE]
(server)
start [RESOURCE]
(server)
reconnect
* (client)
*Reconnect can cause bugs and issues, this is an experimental feature and only meant to be used in development.
See server commands for all server console commands, and client console for all client console (F8) commands.
Adding resources
Adding a resource is as simple as putting the folders name inside of the resources array.
Right now, your resource array is empty. Keep in mind, as you've chosen the Example Resource Pack you've got three example resources.
Load them, by simple adding the folder names*
*The name is case sensitive! - Also templating with [resourceName] isn't gonna work as seen in other multiplayer modifications.
resources = [
'freeroam',
'chat',
'newResource'
]
Typescript Video Tutorial
If you want to learn how to setup a alt:V resource using typescript, watch this video tutorial created by Stuyk: