Resource Start Order and Dependencies: ensure Lines Explained
How FiveM orders ensure lines in server.cfg, what dependency entries in fxmanifest.lua do, and how to fix common startup errors.
FiveM starts resources in the order their ensure lines appear in server.cfg. If one resource needs another, list the required one first. The FiveM manifest also has a dependency key that tells the server to load one resource before the current one, so you can declare the requirement in the resource itself.
What ensure and start do
ensure and start are server console commands that you can also write in server.cfg. Each line runs in order when the server boots.
ensure namestarts a resource that is not running. A forum post quoting a community wiki says that if the resource is already running,ensurerestarts it. (Community report.)start nameonly starts a resource that is not running, according to a forum reply. (Community report.)stop namestops a running resource.
The official docs for this exact wording were not found, so treat the ensure and start descriptions above as community reports.
How dependencies work
The FiveM resource manifest documents two forms. A single entry is dependency 'name'. Several entries use a dependencies { ... } block. The docs say each one "Requires the specified resource to load before the current resource."
dependencies {
'base_framework',
'lib_core'
}
The same keys can also hold runtime requirements, such as a minimum server build. Those are not load-order rules. The manifest docs do not describe them as ordering controls.
A forum thread reports two more behaviors. Restarting a dependency also stops the resources that depend on it, so you must start those again by hand. (Community report.) Two resources should not list each other as dependencies. (Community report.)
Order rules
- Put shared resources first. The FiveM baseevents documentation says a resource that others depend on must start before the third-party resources that use it.
- Declare hard requirements in the manifest too. A
dependencyentry makes the requirement visible in the resource and enforces load order, per the manifest docs. - Use resource names, not folder paths. Community reports say a dependency is written as the resource name, with no path, even if the folders differ. (Community report.)
- Restart dependents after restarting a dependency. Community reports say dependents stop and must be started again. (Community report.)
Worked example
Assume three placeholder resources: lib_core (shared code), base_framework (the framework), and feature_shop (a script that needs the framework).
In server.cfg, start them in this order:
ensure lib_core
ensure base_framework
ensure feature_shop
In the fxmanifest.lua of feature_shop, add the framework as a dependency:
dependencies {
'base_framework'
}
The server.cfg order sets the boot sequence, and the manifest entry states the requirement inside the resource. Keep both: the lines make the order visible to you, and the manifest entry records what the resource needs.
Common errors
- A dependent resource starts too early. A resource that needs something not running yet may fail to start. Move the required resource above it in
server.cfgand read the console line that follows the error. - A dependent stops after a restart. Restarting a base resource stops the resources that depend on it. Start those again. (Community report.)
- Couldn't find resource. The folder name or manifest is wrong, not the order. See fxmanifest.lua Explained for that error.
- Ensure lines in the wrong place for the framework. Some frameworks document their own required order. Check its documentation first, then use the order in server.cfg Explained.
Frequently asked questions
Does ensure order always decide startup order?
Yes for the lines in server.cfg, which run from top to bottom. Use a dependency entry in the manifest for requirements that must hold even if the lines change.
Can I use ensure instead of start?
Both can start a resource at boot. The difference, according to community reports, is that ensure also restarts a running resource. Use start when you do not want a restart.
Do I need both a server.cfg line and a dependency entry?
The docs define the manifest key as load order. A server.cfg line still controls which resources you enable and their order. Keep both for clarity.
Sources
- Resource Manifest (FiveM documentation)
- baseevents (FiveM documentation)
- Resource start order (cfx.re forum)
- Crashed seconds after executing "ensure" command (cfx.re forum)
Last checked: 29 November 2026
Not confirmed: whether FiveM has a soft dependency option; the exact difference between ensure and start beyond community reports; whether a missing dependency blocks a resource from starting; and whether the restart behavior is unchanged in current builds.
FiveM.tools was founded with sponsorship from Nyru.