> For the complete documentation index, see [llms.txt](https://docs.17movement.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.17movement.net/vending-machines/installation.md).

# 📥 Installation

### 1. Requirements

17mov\_VendingMachines requires **oxmysql**.

Make sure `oxmysql` is installed and started before Vending Machines.

The resource automatically detects supported frameworks, inventories and interaction systems, so your framework, inventory and target resource should also start before Vending Machines.

### 2. Add the resource

Place the `17mov_VendingMachines` folder inside your server's `resources/` directory.

Then add this line to your `server.cfg`:

```cfg
ensure 17mov_VendingMachines
```

We recommend keeping it at the **end of `server.cfg`**, after your framework, inventory and target resources.

{% hint style="warning" %}
Start order matters. If Vending Machines starts before your framework or inventory, automatic bridge detection may fall back to standalone mode.
{% endhint %}

### 3. Database setup

The database is installed automatically by default when:

```lua
Config.InstallDatabaseAutomatically = true
```

### 4. Add the required items

Vending Machines uses two items:

| Item              | Purpose                                                                            |
| ----------------- | ---------------------------------------------------------------------------------- |
| `vending_machine` | Used to place a new vending machine                                                |
| `vending_tablet`  | Used to open the management tablet when tablet access is configured to use an item |

Choose your inventory below and copy the provided code into the indicated file or database table.

{% hint style="warning" %}
If you change `Config.RequireItem.ItemName` or `Config.Tablet.ItemName`, make sure the same item names are used in your inventory configuration.
{% endhint %}

{% tabs %}
{% tab title="QBCore" %}
Add the following entries to:

```
qb-core/shared/items.lua
```

```lua
['vending_machine'] = {
    name = 'vending_machine',
    label = 'Vending Machine',
    weight = 15000,
    type = 'item',
    image = 'vending_machine.png',
    unique = true,
    useable = true,
    shouldClose = true,
},

['vending_tablet'] = {
    name = 'vending_tablet',
    label = 'Vending Tablet',
    weight = 700,
    type = 'item',
    image = 'vending_tablet.png',
    unique = true,
    useable = true,
    shouldClose = true,
},
```

{% endtab %}

{% tab title="ESX" %}
If you use the default ESX database item system, run:

```sql
INSERT IGNORE INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
    ('vending_machine', 'Vending Machine', 15, 0, 1),
    ('vending_tablet', 'Vending Tablet', 1, 0, 1)
;
```

{% endtab %}

{% tab title="ox\_inventory" %}
Add the following entries to:

```
ox_inventory/data/items.lua
```

```lua
['vending_machine'] = {
    label = 'Vending Machine',
    weight = 15000,
    stack = false,
    close = true,
    consume = 0,
    server = {
        export = '17mov_VendingMachines.vending_machine'
    },
},

['vending_tablet'] = {
    label = 'Vending Tablet',
    weight = 700,
    stack = false,
    close = true,
    consume = 0,
    server = {
        export = '17mov_VendingMachines.vending_tablet'
    },
},
```

{% endtab %}
{% endtabs %}

### 5. Add item images

Copy the included item images to the image folder used by your inventory:

```
installation/images/vending_machine.png
installation/images/vending_tablet.png
```

### 6. Restart and verify

Restart your server after completing the installation.

If the resource reports that no supported framework or inventory was detected, check your resource start order and make sure `17mov_VendingMachines` starts after them.

{% hint style="info" %}
If automatic detection does not match your setup, bridge selection can be configured manually in `shared/bridge.lua` using `Config.Framework`, `Config.Inventory` and `Config.Interaction`.
{% endhint %}

### Next steps

Once Vending Machines is installed and running correctly, you can customize products, placement rules, the wholesaler, interactions and other behavior in the configuration.

[**⚙️ Continue to Configuration →**](https://docs.17movement.net/vending-machines/configuration)
