Skip to content
This repository was archived by the owner on Aug 9, 2025. It is now read-only.

Run resource

tbeck edited this page Sep 17, 2023 · 3 revisions

Learn how to set up and run a alt:V Go resource


Create a resource

At first we will create a resource folder for our gofreeroom library from the Create project guide.

mkdir resources/gofreeroom

Afterwards copy the built shared library into the newly created folder.
In our example the lib is called gofreeroom.so (on linux) / gofreeroom.dll (on windows)

This is how the folder structure should look like:

server/
├── cache/
├── data/
├── modules/
    ├── go-module.dll # on Windows
    ├── libgo-module.so # on Linux
├── resources/
    ├── gofreeroom/
        ├── gofreeroom.dll # on Windows
        ├── gofreeroom.so # on Linux
├── altv-server.exe
├── server.toml

Create resource config

In order to run a resource, the alt:V server requires a config file named resource.toml.
This file needs to be located at resources/your-resource-name/resource.toml. For our example the path is resources/gofreeroom/resource.toml.

We will use VS Code to edit the resource.toml

# run commands from alt:V server root directory
touch resources/gofreeroom/resource.toml
code resources/gofreeroom/resource.toml

Minimal resource.toml on windows:

type = 'go'
main = 'gofreeroom.dll'

Minimal resource.tomlon linux:

type = 'go'
main = 'gofreeroom.so'

Depending on your OS paste the appropriate minimal resource config content into the file. Your folder structure should look this:

server/
├── cache/
├── data/
├── modules/
    ├── go-module.dll # on Windows
    ├── libgo-module.so # on Linux
├── resources/
    ├── gofreeroom/
        ├── gofreeroom.dll # on Windows
        ├── gofreeroom.so # on Linux
        ├── resource.toml
├── altv-server.exe
├── server.toml

Add resource to server.toml

To tell the alt:V server that it should load the new resource add it to the resources list in the server.toml config file:

Before

name = 'alt:V Server'
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',
    'go-module'
]
resources = []

After

name = 'alt:V Server'
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',
    'go-module'
]
resources = [
    'gofreeroom'
]

🚀 You are ready to start the alt:V server!

Clone this wiki locally