How to Change Your Flarum Admin Link
By default, Flarum's administration panel is located at:
https://yourforum.com/admin
If you would rather use a custom URL, such as:
https://yourforum.com/control-panel
Flarum makes this surprisingly easy. The admin path is defined in your installation's config.php file. This option is still present in Flarum 2.x. :chatgpt-content-reference{index="1"}
1. Locate Your Flarum config.php
Connect to your server using SSH and navigate to the root of your Flarum installation.
For example:
cd /var/www/flarum
You should see a file named:
config.php
Before modifying it, it's always a good idea to create a backup:
cp config.php config.php.backup
Then open the file:
nano config.php
2. Find the paths Section
Inside config.php, look for something similar to:
'paths' =>
array (
'api' => 'api',
'admin' => 'admin',
),
According to Flarum's current configuration documentation, the admin value controls the path used for Flarum's administration interface. :chatgpt-content-reference{index="2"}
3. Change the Admin Path
Change:
'admin' => 'admin',
to whatever you'd like your new admin path to be.
For example:
'paths' =>
array (
'api' => 'api',
'admin' => 'control-panel',
),
Your administration panel would then be located at:
https://yourforum.com/control-panel
You can choose something less obvious than control-panel, but avoid spaces and unusual characters.
Save the file in Nano with:
CTRL + O
Enter
CTRL + X
4. Clear the Flarum Cache
From your Flarum installation directory, run:
php flarum cache:clear
Then open your new admin URL in your browser.
Using our example:
https://yourforum.com/control-panel
Flarum's own URL generator uses the configured admin application URL, so internal references to the administration panel are generated from Flarum's configuration rather than simply assuming /admin. :chatgpt-content-reference{index="3"}
5. Test the Old /admin URL
Now try visiting:
https://yourforum.com/admin
Your administration panel should instead be available at the custom path you configured.
If something doesn't work, restore your backup:
cp config.php.backup config.php
php flarum cache:clear
Does Changing /admin Make Flarum More Secure?
Only slightly.
Changing the default admin path can reduce automated requests and scanners looking specifically for:
/admin
But the new URL should not be treated as a password or major security control. Administrator authentication, strong passwords, server security, updates, HTTPS, firewall configuration and other protections remain much more important.
Think of changing the admin URL as reducing unnecessary exposure rather than making the admin panel inaccessible to a determined attacker.
That's It!
One of the nice things about Flarum is that you don't need to rename directories or modify Flarum's core files to change the admin path. It's controlled through config.php.
Flarum's current 2.x documentation confirms the configuration structure as:
'paths' =>
array (
'api' => 'api',
'admin' => 'admin',
),
so the change is easy to reverse if necessary.