{"id":1102,"date":"2020-07-07T19:20:00","date_gmt":"2020-07-07T23:20:00","guid":{"rendered":"https:\/\/www.ectropyarts.com\/?p=1102"},"modified":"2020-10-07T23:49:12","modified_gmt":"2020-10-08T03:49:12","slug":"how-to-install-wordpress-with-almost-just-the-command-line","status":"publish","type":"post","link":"https:\/\/www.ectropyarts.com\/how-to-install-wordpress-with-almost-just-the-command-line\/","title":{"rendered":"How to install WordPress with (almost) just the command line"},"content":{"rendered":"
This guide intends to walk you through every step of a WordPress<\/a> install, and to avoid the use of a GUI whenever possible. It was designed with NearlyFreeSpeech.NET<\/a> hosting in mind, but may be helpful on other hosts as well.<\/p>\n First, we’ll set up the database that WordPress needs to run.<\/p>\n To get the latest for WordPress. It may take a few moments. Wait for it to complete.<\/li>\n The actual command should look something like this below (but won’t be exactly the same)<\/p>\n To change the permissions of the wp-config.php file.<\/li>\n The actual command should look something like this below (but won’t be exactly the same)<\/p>\n This should ensure that you can upload files to your site (based on the recommendation here<\/a>.)<\/li>\n This creates an empty This will allow the web server to create and modify files. It also sets proper permissions for directories and files. It’s riskier than using the WordPress CLI from a security standpoint, but more convenient for WordPress users.<\/li>\n And that’s it! WordPress should be set up and ready to go! You can visit and log in to your site using the admin credentials and the URL you specified in step 19.<\/p>\n\n
wp core download<\/pre>\n
wp core config --dbhost=[step14] --dbname=[step3] --dbuser=[step7] --dbpass=[step8]<\/pre>\n
wp core config --dbhost=hostname.db --dbname=sitenamewp --dbuser=wpuser_sitename --dbpass=R@ndomP@$w0rd<\/pre>\n<\/li>\n
chmod 644 wp-config.php<\/pre>\n
wp core install --url=[url] --title=\"[title]\" --admin_user=[user] --admin_password=[pass] --admin_email=[email]<\/pre>\n
wp core install --url=sitename.nfshost.com --title=\"Site Name\" --admin_user=AdminUsername --admin_password=AdminP@$w0rd --admin_email=example@example.com<\/pre>\n<\/li>\n
cd wp-content\nmkdir -p uploads\nchgrp -R web uploads\nchmod -R 775 uploads\ncd ..<\/pre>\n
touch .htaccess<\/pre>\n
.htaccess<\/code> file, which can be used for setting up permalinks.<\/li>\n
chgrp -R web ..\/public\nfind ..\/public -type f -exec chmod 664 {} \\;\nfind ..\/public -type d -exec chmod 775 {} \\;\nchgrp -R web *\nfind . -type d -exec chmod 775 {} \\;\nfind . -type f -exec chmod 664 {} \\;<\/pre>\n
define('FS_METHOD','direct'); <\/code>to the
wp-config.php<\/code> file, immediately before the
\/* That's all, stop editing! Happy publishing. *\/<\/code> line. This can make WordPress, Theme, and Plugin upgrades easier, but be sure you are aware of the security concerns<\/a> before doing this. To edit the
wp-config.php<\/code> file…
\nRun pico wp-config.php<\/code>
\nAdd define('FS_METHOD','direct');<\/code>in the location described above
\nPress CTRL + X to exit pico
\nThen press Y to Save modified buffer, then press Enter to confirm the save.<\/li>\nhistory -c<\/pre>\n<\/li>\n
exit<\/code> command<\/li>\n<\/ol>\n