{"id":62,"date":"2020-01-25T04:42:32","date_gmt":"2020-01-25T04:42:32","guid":{"rendered":"https:\/\/serverhub.com\/kb\/?p=62"},"modified":"2021-11-30T01:01:43","modified_gmt":"2021-11-30T01:01:43","slug":"how-to-install-a-fivem-server-on-linux","status":"publish","type":"post","link":"https:\/\/serverhub.com\/kb\/how-to-install-a-fivem-server-on-linux\/","title":{"rendered":"How To Install a FiveM Server on Linux"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"linux\">Linux<a href=\"https:\/\/docs.fivem.net\/docs\/server-manual\/setting-up-a-server\/#linux\"><\/a><\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Create a new folder (for example&nbsp;<code>mkdir \/home\/username\/FXServer\/server<\/code>), this will be used for the server binaries.<\/li><li>Download the latest&nbsp;<code>master<\/code>&nbsp;branch build for Linux from the&nbsp;<a href=\"https:\/\/runtime.fivem.net\/artifacts\/fivem\/build_proot_linux\/master\/\">artifacts server<\/a>(copy the URL for the latest server version and use&nbsp;<code>wget &lt;url&gt;<\/code>&nbsp;to download it).<\/li><li>Extract the build to the directory that was previously created, using&nbsp;<code>cd \/home\/username\/FXServer\/server &amp;&amp; tar xf fx.tar.xz<\/code>&nbsp;(you need to have&nbsp;<code>xz<\/code>&nbsp;installed, on Debian\/Ubuntu this is in the&nbsp;<code>xz-utils<\/code>&nbsp;package).<\/li><li>Clone&nbsp;<a href=\"https:\/\/github.com\/citizenfx\/cfx-server-data\">cfx-server-data<\/a>&nbsp;in a new folder outside of your server binaries folder.<br>4b. For example&nbsp;<code>git clone https:\/\/github.com\/citizenfx\/cfx-server-data.git \/home\/username\/FXServer\/server-data<\/code><\/li><li>Make a&nbsp;<strong>server.cfg<\/strong>&nbsp;file in your&nbsp;<code>server-data<\/code>&nbsp;folder (copy the&nbsp;<a href=\"https:\/\/docs.fivem.net\/docs\/server-manual\/setting-up-a-server\/#servercfgexample\">example server.cfg<\/a>&nbsp;file below into that file).<\/li><li>Generate a license key at&nbsp;<a href=\"https:\/\/keymaster.fivem.net\/\">https:\/\/keymaster.fivem.net<\/a>.<\/li><li>Set the license key in your&nbsp;<code>server.cfg<\/code>&nbsp;using&nbsp;<code>sv_licenseKey \"licenseKeyGoesHere\"<\/code>.<\/li><li>Run the server from the&nbsp;<code>server-data<\/code>&nbsp;folder.<br>8b.&nbsp;<code>bash \/home\/username\/FXServer\/server\/run.sh +exec server.cfg<\/code><\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"common-issues\">Common issues<a href=\"https:\/\/docs.fivem.net\/docs\/server-manual\/setting-up-a-server\/#common-issues\"><\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>If you don&#8217;t get any \u2018resources found\u2019, and it says \u2018Failed to start resource\u2019, you didn&#8217;t \u2018cd\u2019 to the right folder.<\/li><li>If you get a lot of errors about citizen:\/scripting\/, you didn&#8217;t use run.cmd.<\/li><li>If nothing happens at all except \u2018sending heartbeat\u2019, you didn&#8217;t use run.cmd&nbsp;<strong>and<\/strong>&nbsp;failed to cd to the folder.<\/li><li>If no resources get started, and you can&#8217;t connect, you didn&#8217;t add +exec.<\/li><li>If you get \u2018no license key was specified\u2019, one of the above things applies.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a-nameservercfgexampleaservercfg\">server.cfg<a href=\"https:\/\/docs.fivem.net\/docs\/server-manual\/setting-up-a-server\/#a-nameservercfgexampleaservercfg\"><\/a><\/h2>\n\n\n\n<p>An example server.cfg follows.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Only change the IP if you're using a server with multiple network interfaces, otherwise change the port only.\nendpoint_add_tcp \"0.0.0.0:30120\"\nendpoint_add_udp \"0.0.0.0:30120\"\n\n# These resources will start by default.\nensure mapmanager\nensure chat\nensure spawnmanager\nensure sessionmanager\nensure fivem\nensure hardcap\nensure rconlog\nensure scoreboard\n\n# This allows players to use scripthook-based plugins such as the legacy Lambda Menu.\n# Set this to 1 to allow scripthook. Do note that this does _not_ guarantee players won't be able to use external plugins.\nsv_scriptHookAllowed 0\n\n# Uncomment this and set a password to enable RCON. Make sure to change the password - it should look like rcon_password \"YOURPASSWORD\"\n#rcon_password \"\"\n\n# A comma-separated list of tags for your server.\n# For example:\n# - sets tags \"drifting, cars, racing\"\n# Or:\n# - sets tags \"roleplay, military, tanks\"\nsets tags \"default\"\n\n# A valid locale identifier for your server's primary language.\n# For example \"en-US\", \"fr-CA\", \"nl-NL\", \"de-DE\", \"en-GB\", \"pt-BR\"\nsets locale \"root-AQ\" \n# please DO replace root-AQ on the line ABOVE with a real language! :)\n\n# Set an optional server info and connecting banner image url.\n# Size doesn't matter, any banner sized image will be fine.\n#sets banner_detail \"https:\/\/url.to\/image.png\"\n#sets banner_connecting \"https:\/\/url.to\/image.png\"\n\n# Set your server's hostname\nsv_hostname \"FXServer, but unconfigured\"\n\n# Nested configs!\n#exec server_internal.cfg\n\n# Loading a server icon (96x96 PNG file)\n#load_server_icon myLogo.png\n\n# convars which can be used in scripts\nset temp_convar \"hey world!\"\n\n# Uncomment this line if you do not want your server to be listed in the server browser.\n# Do not edit it if you *do* want your server listed.\n#sv_master1 \"\"\n\n# Add system admins\nadd_ace group.admin command allow # allow all commands\nadd_ace group.admin command.quit deny # but don't allow quit\nadd_principal identifier.fivem:1 group.admin # add the admin to the group\n\n# Hide player endpoints in external log output.\nsv_endpointprivacy true\n\n# Server player slot limit (must be between 1 and 32, unless using OneSync)\nsv_maxclients 32\n\n# Steam Web API key, if you want to use Steam authentication (https:\/\/steamcommunity.com\/dev\/apikey)\n# -&gt; replace \"\" with the key\nset steam_webApiKey \"\"\n\n# License key for your server (https:\/\/keymaster.fivem.net)\nsv_licenseKey changeme<\/code><\/pre>\n\n\n\n<p><strong>If you liked this one, we recommend our effortless LAMP stack tutorials:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><a href=\"https:\/\/serverhub.com\/kb\/howto\/beginners-guide-what-is-ubuntu-linux-and-how-to-install-it\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><strong><strong><a href=\"https:\/\/serverhub.com\/kb\/what-is-ubuntu-linux-and-how-to-install-it\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to install the latest Ubuntu Linux? Beginner\u2019s guide<\/a><\/strong><\/strong><\/li><li><a href=\"https:\/\/serverhub.com\/kb\/how-to-install-apache-on-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>How To Install Apache On Ubuntu? <\/strong><\/a><strong><a href=\"https:\/\/serverhub.com\/kb\/how-to-install-apache-on-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">The <\/a><\/strong><a href=\"https:\/\/serverhub.com\/kb\/how-to-install-apache-on-ubuntu\/\"><strong>Comprehensive Guide<\/strong><\/a><\/li><li><a href=\"https:\/\/serverhub.com\/kb\/how-to-install-mysql-on-ubuntu-the-proven-2021-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>How To Install MySQL On Ubuntu? The Proven 2021 Guide<\/strong><\/a><\/li><li><strong><a href=\"https:\/\/serverhub.com\/kb\/how-to-install-php-on-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>How to Install PHP on Ubuntu 20.04? Step-by-step Easy Guide<\/strong><\/a><\/strong> <\/li><\/ol>\n\n\n\n<p>Or read more of our most read:<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/serverhub.com\/kb\/howto\/how-to-install-a-fivem-server-on-windows\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Install A FiveM <\/a><a href=\"https:\/\/serverhub.com\/kb\/how-to-install-a-fivem-server-on-windows\/\">Server <\/a><a href=\"https:\/\/serverhub.com\/kb\/howto\/how-to-install-a-fivem-server-on-windows\/\">On Windows<\/a><\/strong><br><strong><a href=\"https:\/\/serverhub.com\/kb\/mysql-the-most-popular-open-source-database-system\/\" target=\"_blank\" rel=\"noreferrer noopener\">MySQL: The Most Popular Open-Source Database<\/a><\/strong> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux Create a new folder (for example&nbsp;mkdir \/home\/username\/FXServer\/server), this will be used for the server binaries. Download the latest&nbsp;master&nbsp;branch build for Linux from the&nbsp;artifacts server(copy the URL for the latest server version and use&nbsp;wget &lt;url&gt;&nbsp;to download it). Extract the build to the directory that was previously created, using&nbsp;cd \/home\/username\/FXServer\/server &amp;&amp; tar xf fx.tar.xz&nbsp;(you need to &#8230; <a title=\"How To Install a FiveM Server on Linux\" class=\"read-more\" href=\"https:\/\/serverhub.com\/kb\/how-to-install-a-fivem-server-on-linux\/\" aria-label=\"More on How To Install a FiveM Server on Linux\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[7],"tags":[45,10],"class_list":["post-62","post","type-post","status-publish","format-standard","hentry","category-linux-administration","tag-fivem","tag-linux-administration"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/posts\/62","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/comments?post=62"}],"version-history":[{"count":3,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/posts\/62\/revisions"}],"predecessor-version":[{"id":1067,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/posts\/62\/revisions\/1067"}],"wp:attachment":[{"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/media?parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/categories?post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serverhub.com\/kb\/wp-json\/wp\/v2\/tags?post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}