<p>As @user suggested, Just create a <strong>virtual host</strong> by following the below mentioned steps.</p>
<p>Complete Article : <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts" rel="nofollow noreferrer">Virtual Host</a></p>
<ol>
<li><p>sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/craftcms.local.conf</p>
</li>
<li><p>sudo nano /etc/apache2/sites-available/craftcms.local.conf</p>
</li>
<li><p>Paste the below lines in above file (<code>craftcms.local.conf</code>)</p>
<pre><code> &lt;VirtualHost *:80&gt;
        ServerName craftcms.local
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/craftcms/web/
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        &lt;Directory /var/www/html&gt;
                 Options Indexes FollowSymLinks MultiViews
                 AllowOverride ALL
                 Require all granted
        &lt;/Directory&gt;
&lt;/VirtualHost&gt;

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
</code></pre>
</li>
<li><p>sudo a2ensite craftcms.local.conf</p>
</li>
<li><p>sudo service apache2 restart</p>
</li>
<li><p>sudo nano /etc/hosts</p>
<p>add a new hosts at the end of this file like
<code>127.0.0.1   craftcms.local</code></p>
</li>
<li><p>Open your browser and hit <code>craftcms.local</code> frontend and <code>craftcms.local/admin</code> for admin</p>
</li>
</ol>

CC BY-SA 4.0
2019-10-22T08:36:50.787Z
thanks for the guidance, this worked perfectly.
falcon
CC BY-SA 4.0
2019-10-25T06:04:15.877Z
@falcon , you can mark the answer as accepted or even you can share your's as answer.
inrsaurabh
CC BY-SA 4.0
2020-09-21T20:25:29.393Z
@falcon did you solve your problem ?
umer
CC BY-SA 4.0
2022-07-16T03:18:33.373Z
Maybe this will help someone else, but I also needed to manually enable the Apache Rewrite module. `sudo a2enmod rewrite && sudo service apache2 restart`
blendenzo
CC BY-SA 4.0
2023-03-01T21:49:41.640Z
@blendenzo  - Thanks for this comment. That's what fixed this issue for me too.
xtianjs
CC BY-SA 4.0
2019-10-29T11:03:22.353Z
@saurabh, I again followed the same steps on Ubuntu 19.10 but this time the control panel url [http://craftcms.local/admin] shows the same 404 Not Found error. What to do now?
falcon
CC BY-SA 4.0
2019-10-29T12:11:43.953Z
craftcms.local shows the Welcome Page but when you click on control panel [craftcms.local/admin] it shows 404 error not found :(
falcon
CC BY-SA 4.0
2019-10-29T13:08:19.297Z
@falcon  check your .env at root of the project and update/add `DEFAULT_SITE_URL="craftcms.local"`
inrsaurabh
CC BY-SA 4.0
2019-10-30T07:12:38.680Z
it's already there in the .env file.
falcon
CC BY-SA 4.0
2019-09-30T05:33:07.000Z
2019-09-30T05:33:07.000Z
2020-06-17T08:56:27.903Z
inrsaurabh
<p>You need to set the web server to host from the /web directory. At present it looks like you are serving a folder that contains the Craft folder.</p>

CC BY-SA 4.0
2019-09-29T14:37:22.500Z
2019-09-29T14:37:22.500Z
dmatthams
<p>I have installed craftcms 3 on my localhost. It got installed and the following screen appeared:
<a href="https://i.sstatic.net/zqJUc.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zqJUc.png" alt="screen which appears"></a></p>

<p>If I click on Control Panel I see the following screen</p>

<p><a href="https://i.sstatic.net/sJUI2.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sJUI2.png" alt="error 404 not found"></a></p>

CC BY-SA 4.0
2019-09-30T05:34:06.000Z
I added minimum steps to make a virtual host and this will surely solve your issue.
inrsaurabh
CC BY-SA 4.0
2019-10-03T07:48:57.963Z
Is your problem solved?
inrsaurabh
CC BY-SA 4.0
2019-10-22T08:37:28.483Z
yes and thanks for the guidance
falcon
CC BY-SA 4.0
2020-12-17T07:43:22.113Z
I am getting same error but i did this code with in 000-default.conf but i get same error, what is file permission 777 of web,config,modules,composer.lock,comsoper.json my virtual host -> http://mycraftserver.test/admin/login
<VirtualHost *:80> ServerName craftcms.local ServerAdmin webmaster@localhost DocumentRoot /var/www/html/craft/web/ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride ALL Require all granted </Directory>
</VirtualHost>
Sandip Das
CC BY-SA 4.0
2023-10-26T14:55:26.673Z
I am having the same issue, I tried the host file craftcms.local.conf, but it's not working for me. It worth to say that I installed CraftCMS by downloading the zip from the git releases and `./craft install` because I need the exact version `4.4.14`
ruycr4ft
<error><admin><404>
Control Panel or admin dashboard not found
# Control Panel or admin dashboard not found

(Asked by: username_0 on 2019-09-28)

I have installed craftcms 3 on my localhost. It got installed and the following screen appeared:
[![screen which appears](https://i.sstatic.net/zqJUc.png)](https://i.sstatic.net/zqJUc.png)

If I click on Control Panel I see the following screen

[![error 404 not found](https://i.sstatic.net/sJUI2.png)](https://i.sstatic.net/sJUI2.png)

**Tags:** error, admin, 404
> **Comments:**
> **username_1**: I added minimum steps to make a virtual host and this will surely solve your issue.  
> **username_1**: Is your problem solved?  
> **username_0**: yes and thanks for the guidance  
> **username_2**: I am getting same error but i did this code with in 000-default.conf but i get same error, what is file permission 777 of web,config,modules,composer.lock,comsoper.json my virtual host -> http://mycraftserver.test/admin/login <VirtualHost *:80> ServerName craftcms.local ServerAdmin webmaster@localhost DocumentRoot /var/www/html/craft/web/ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride ALL Require all granted </Directory> </VirtualHost>  
> **username_3**: I am having the same issue, I tried the host file craftcms.local.conf, but it's not working for me. It worth to say that I installed CraftCMS by downloading the zip from the git releases and `./craft install` because I need the exact version `4.4.14`  

---

## 2 answers

### Answer by username_1 on 2019-09-30. Score: 2 | Accepted answer

As @user suggested, Just create a virtual host by following the below mentioned steps.
Complete Article : Virtual Host

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/craftcms.local.conf

sudo nano /etc/apache2/sites-available/craftcms.local.conf

Paste the below lines in above file (craftcms.local.conf)
 
        ServerName craftcms.local
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/craftcms/web/
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        
                 Options Indexes FollowSymLinks MultiViews
                 AllowOverride ALL
                 Require all granted
        


# vim: syntax=apache ts=4 sw=4 sts=4 sr noet


sudo a2ensite craftcms.local.conf

sudo service apache2 restart

sudo nano /etc/hosts
add a new hosts at the end of this file like
127.0.0.1   craftcms.local

Open your browser and hit craftcms.local frontend and craftcms.local/admin for admin

> **Comments:**
> **username_0**: thanks for the guidance, this worked perfectly.  
> **username_1**: @falcon , you can mark the answer as accepted or even you can share your's as answer.  
> **username_0**: @saurabh, I again followed the same steps on Ubuntu 19.10 but this time the control panel url [http://craftcms.local/admin] shows the same 404 Not Found error. What to do now?  
> **username_0**: craftcms.local shows the Welcome Page but when you click on control panel [craftcms.local/admin] it shows 404 error not found :(  
> **username_1**: @falcon  check your .env at root of the project and update/add `DEFAULT_SITE_URL="craftcms.local"`  
> **username_0**: it's already there in the .env file.  
> **username_4**: @falcon did you solve your problem ?  
> **username_5**: Maybe this will help someone else, but I also needed to manually enable the Apache Rewrite module. `sudo a2enmod rewrite && sudo service apache2 restart`  
> **username_6**: @blendenzo  - Thanks for this comment. That's what fixed this issue for me too.  

---

### Answer by username_7 on 2019-09-29. Score: 2

You need to set the web server to host from the /web directory. At present it looks like you are serving a folder that contains the Craft folder.


---

