A FiveM server that has been running for 12 or 24 hours without a restart is a server quietly accumulating problems. Lua state fragments, uncleaned event handlers, orphaned entity objects, and oversized in-memory caches all add up. Players notice it as rubber-banding, script errors, and eventually outright crashes during peak hours. The fix is not complicated — scheduled restarts are built directly into txAdmin, the management platform bundled with every FiveM server — but a surprising number of server owners either never configure them or configure them badly. This guide covers exactly how to do it right: setting restart times, tuning countdown warnings, listening to restart events for custom UI, and skipping a restart when your maintenance window just passed.
Why Scheduled Restarts Matter (Memory Leaks in Brief)
FiveM runs a Lua runtime alongside the FXServer process. Every resource that starts registers globals, event handlers, and object references. When a poorly written resource does not clean up on resource stop — or when circular table references prevent the garbage collector from reclaiming memory — RSS (resident set size) grows across a session and never comes back down. A 12-hour server with busy scripts can end up consuming several gigabytes more than a freshly restarted one.
Scheduled restarts do not fix leaky scripts, but they do give you a predictable, low-population window to clear fragmented state, reclaim OS-level memory, and apply any artifact updates you have staged. Think of them as routine hygiene rather than a band-aid — and pair them with actual leak diagnosis (profile your resources, disable half at a time, measure RSS over hours) so you are fixing root causes in parallel.
If you are still setting up your server environment, the XGamingServer FiveM documentation hub covers everything from license key creation to installing frameworks before you start tuning the scheduler.
Navigating to the Scheduler in txAdmin
txAdmin is accessible at port 40120 on your server host (or through your control panel’s txAdmin button if you are on a managed FiveM host). Once logged in:
- Click Settings in the left-hand sidebar.
- Scroll to the Scheduled Restarts section.
- Use the interface to add restart times in 24-hour format (e.g.
06:00,12:00,18:00).
The same Settings page also exposes two other automatic restart triggers: On Crash (txAdmin restarts FXServer if it detects a crash or hang) and On High Memory (restart if process memory exceeds a configured threshold). All three work independently and can all be enabled at once. The Scheduled Restarts section is what the rest of this guide focuses on.
Choosing Your Restart Schedule
The right schedule depends on your script load and community size, not a universal rule. Common patterns:
- Two restarts per day (e.g. 06:00 and 18:00) — popular default, hits low-population windows in most timezones.
- Three or four restarts per day (e.g. 00:00, 06:00, 12:00, 18:00) — better for heavy RP servers with large script counts or persistent world data.
- Single overnight restart (e.g. 04:00) — suitable for light servers where memory growth is slow and player disruption tolerance is low.
The key principle: schedule restarts during your consistently lowest player-count windows. Check your player graphs in the txAdmin dashboard over a week before committing to times.
How txAdmin Broadcasts Restart Warnings
Once a scheduled restart time is configured, txAdmin handles countdown announcements automatically. According to the official txAdmin events documentation, the txAdmin:events:scheduledRestart event is broadcast to all server resources at the following intervals before the restart:
30 minutes, 15 minutes, 10 minutes, 5 minutes, 4 minutes, 3 minutes, 2 minutes, 1 minute
Each broadcast includes a secondsRemaining value and a translatedMessage string (localised to the locale configured in txAdmin). By default, txAdmin displays these warnings as in-game chat announcements visible to all connected players. This behaviour is intentional — players need notice before being disconnected, especially mid-roleplay scene.
Suppressing Default Warnings for Custom UI
If your server uses a custom notification framework (ox_lib notifications, a bespoke HUD, etc.) you may not want txAdmin’s plain chat announcements overlapping with your styled ones. Two convars in your server.cfg control this:
# Suppress txAdmin's default scheduled restart countdown chat messages
setr txAdmin-hideDefaultScheduledRestartWarning true
# Suppress txAdmin's default admin broadcast messages
setr txAdmin-hideDefaultAnnouncement true
With txAdmin-hideDefaultScheduledRestartWarning set to true, the default chat messages are suppressed but the txAdmin:events:scheduledRestart event is still fired on schedule. Your own resource can listen to that event and display a styled notification instead:
-- In your resource's server-side script
AddEventHandler('txAdmin:events:scheduledRestart', function(eventData)
-- eventData.secondsRemaining (number, seconds until restart)
-- eventData.translatedMessage (string, txAdmin localised text)
local minutesLeft = math.floor(eventData.secondsRemaining / 60)
TriggerClientEvent('yourHud:notify', -1,
string.format('Server restart in %d minute(s). Wrap up your activities.', minutesLeft),
'warning'
)
end)
The txAdmin:events:serverShuttingDown event fires just before the actual restart with a delay (milliseconds), author, and message payload — useful for triggering last-second saves or notifying a Discord webhook.
Skipping the Next Scheduled Restart
Suppose you just pushed a hotfix and manually restarted the server at 17:45 — your 18:00 scheduled restart would kick players again 15 minutes later for no good reason. txAdmin includes a Skip Next Restart button in the dashboard for exactly this situation. Clicking it cancels only the next upcoming restart; the one after that fires normally.
When an admin skips a restart, txAdmin fires txAdmin:events:scheduledRestartSkipped with three payload fields: secondsRemaining (how far away the cancelled restart was), temporary (boolean — whether it was a one-off or a configured time), and author (the admin’s username). This lets you log the action or notify a staff Discord channel automatically.
Note on deprecated events: if your server has older custom scripts that listen to txAdmin:events:skippedNextScheduledRestart, migrate them to txAdmin:events:scheduledRestartSkipped. The old event name was deprecated in txAdmin v8.0 and will stop working in a future release.
Restart Triggers at a Glance
| Trigger Type | Location in txAdmin | When It Fires | Primary Use Case |
|---|---|---|---|
| Scheduled | Settings → Scheduled Restarts | Configured 24h clock times | Routine memory clearance, low-pop maintenance |
| On Crash / Hang | Settings → Scheduled Restarts | FXServer process crashes or stops responding | Automatic recovery without admin intervention |
| On High Memory | Settings → Scheduled Restarts | Process RAM exceeds configured threshold | Safety net for severe leaks before OOM kill |
| Manual | Dashboard → Stop/Restart button | Admin-initiated at any time | Hotfixes, urgent maintenance |
Practical Tips for a Player-Friendly Restart Routine
- Anchor restarts to your community’s dead hours. Most NA RP servers have a lull between 04:00–07:00 EST — put at least one restart there.
- Do not restart to mask crashes. If your server crashes every 90 minutes, more scheduled restarts just paper over a resource that needs fixing. Use txAdmin’s live resource monitoring and the
resmoncommand to find the culprit. - Pair restarts with backups. A pre-restart database dump or file snapshot means you have a clean save point before each cycle. See our guide on FiveM server backups for a practical workflow.
- Communicate the schedule publicly. Put restart times in your Discord server rules and on your loading screen. Players who know the schedule do not interpret restarts as crashes.
- Test your custom event handlers. After adding restart warning scripts, manually trigger a txAdmin restart from the dashboard and confirm your notification UI fires at the right intervals before relying on it in production.
If your server is growing and you want a managed environment where txAdmin comes pre-configured, take a look at our FiveM server hosting plans — txAdmin is available on every tier with one-click access from the control panel.
Frequently Asked Questions
How many scheduled restarts per day should I configure?
Most servers do well with two restarts per day — one during a late-night/early-morning low and one during a midday lull. Heavy RP servers running 50+ resources with persistent world databases sometimes benefit from three or four. Start with two, monitor your RSS growth curve in the txAdmin dashboard over a week, and add more only if memory is still climbing significantly before each restart window.
Can I cancel a scheduled restart that is already counting down?
Yes. Click the Skip Next Restart button in the txAdmin dashboard at any point during the countdown — even at the one-minute warning. The restart is cancelled for that occurrence only; the next scheduled time resumes as normal. When a restart is skipped, txAdmin fires txAdmin:events:scheduledRestartSkipped so any listening resources can react accordingly (e.g. dismiss a countdown overlay in your HUD).
What is the difference between the “On Crash” restart and a scheduled restart?
“On Crash” is a reactive trigger — txAdmin detects that FXServer has stopped responding or exited unexpectedly and immediately relaunches it, with no countdown warning. Scheduled restarts are proactive and planned, with the full 30-minute countdown warning sequence so players have time to wrap up. Both are independent settings and should both be enabled: crash recovery as your safety net, scheduled restarts as your maintenance routine. You can also learn more about managing player actions around restarts in our FiveM ban and kick management guide.
Ready to play?
Run your own FiveM server with XGamingServer
Spin up an always-on FiveM server your friends can join in minutes — no port-forwarding, no tech headaches.






