Showing results for 
Search instead for 
Did you mean: 

Magento 2 404 Error Admin Post Installation

Magento 2 404 Error Admin Post Installation

Hi there, I just manually installed Magento2 CE on Ubuntu server 18.04 with LAMP via composer, the install went ok and all checks were on green however the link given after installation to access the magento admin page is giving error 404.

To resolve this a few people say it should work by changing from the config:

sudo nano /etc/apache2/apache2.conf


Options Indexes FollowSymLinks AllowOverride None Require all granted



Options Indexes FollowSymLinks AllowOverride All Require all granted


But is still not working, another tutorials also say to change the file pub/.htaccess to magento root folder which im guessing it would be located default on: /var/www/html/magento However I'm new to Ubuntu commands and I'm unable to find any suggestions of hwo to do this, would it work with this?

sudo mv /var/www/html/magento/pub/.htaccess /var/www/html/magento


If, I tried it and is not working, any suggestions?? or anyone here who have fixed this issue before??.


I need to mention that when completing the install through composer it was installed on /var/www/html/magento-community-edition/ folder and I moved it up and took out the file "magento-community edition and as a result all the installlation files went to /var/www/html/ so I don't know if that made up the error, how do I fix it? Thank you for your assistance.


Re: Magento 2 404 Error Admin Post Installation

Hi @brayan_monterroso,


Is the mod_rewrite enabled on your server?


If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Magento 2 404 Error Admin Post Installation

Yes, they are, I tried many different solutions online but is not working.

Re: Magento 2 404 Error Admin Post Installation

Re: Magento 2 404 Error Admin Post Installation

I am getting 404 not found when click on admin url

I have mode_rewrite enable on server. I checked with both magento 2.0.x and 2.2.3 , no success.

Also , I tried below solutions from google 

php -f bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
chown -R myusername:myusername /magento-modules
chmod -R 755 /magento-modules

php bin/magento cache:clean
rm -rf var/cache/*
rm -rf var/generation/*
rm -rf generated/* (for magento 2.2.x)
php bin/magento deploy:mode:show
php bin/magento deploy:mode:set production
php bin/magento info:adminuri

-Thanks & Regards,Shahab