Ubuntu 18.04 Server Par WordPress Install Kaise Kare (with LEMP)

Kya aap DigitalOcean server LEMP stack par wordpress install karna chahate hai. Is post me aapko Ubuntu 18.04 par LEMP (Linux, Nginx, MySQL, and PHP) ke sath WordPress install karne ki (step by step with screenshot and example) hindi jankari milegi. How to Install WordPress on LEMP in Hindi – Beginner guide 2024.

Install WordPress with LEMP on Ubuntu 18.04

Yaha par di gayi guideline ko follow karke aap aasani se LEMP stack par wordpress installation setup kar sakte ho. Agar aapko koi bhi doubt ya problem ho to aap comment section me puch sakte hai.

Ubuntu 18.04 server par WordPress install karne se pahle aapko kuch jaruri process complete karni hongi. Jo nimn prakar hai.

1. Buy Hosting Server

Sabse pahle hume LEMP stock install karne ke liye hosting server ki jarurat hogi. Aap DigitalOcean se $100 free credit ke sath hosting buy kar sakte hai.

2. Setup Server

Server create karne ke bad aapko droplete create karna hai. Jiski janakri alag se is post me di gayi hai.

3. Log in on Server via SSH

Droplet create karne ke bad hume command console me login karna hai. Iske liye aap PUTTY use kar sakte hai jiski janakri yaha hai.

4. Install a LEMP Stack

Ubuntu par wordpress install karne se pahle aapko ubuntu server par Linux, Nginx, MySQL/MariaDB, PHP (LEMP) install karna hoga. Iski jankari ke liye ye tutorial check kare.

In 4th steps ko complete karne ke bad aap lemp stack par wordpress install karna shuru kar sakte hai.

How to Install WordPress on LEMP (Linux, Nginx, MySQL/MariaDB, PHP) on Ubuntu 18.04

Sabhi steps ko dhyan se aur sahi se command type or paste kare taki koi problem na ho.

1. Create a MySQL Database and User for WordPress

Sabse pahle hum MySQL setup karenge. WordPress site aur users ki information manage and storage karne ke liye MySQL ka istemal akrta hai.

Hum pahle se LEMP set up me MySQL install kar chuke hai lekin hume database aur wordpress ke istemal ke liye ek user account banane ki jarurat hai.

MySQL me log in karne ke liye is command ka use kare.

$mysql -u root -p

Ab aapse MySQL password ke liye pucha jayega. Yaha aapko wo password add karna hai jo aapne MySQL install karte time mySQL root account ke liye set kiya tha.

Ab hum ekl alag separate database bana sakte hai jo humare wordpress application dwara use kiya jayega. Is guide me main databse ka name wordpress set kar raha hu.

Databse create karne ke liye ye command use kare.

mysql>CREATE DATABASE wordpress;

Note:- Dhyan rahe har command ke last me semi-colon (;) hona chahiye ye command end karta hai.

Ab humare pas ek database hai or hum ek user create karne ke liye ready hai. Aap apne hisab se strong password or username choose kar sakte hai.

Username or password set karne ke liye ye command type kare.

mysql>CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';

Ab humare pas ek databse and ek user hai lekin humne abhi in dono ko ek dusre se connect nahi kiya hai. Hume MySQL ko ye btane ki jarurat hai ki humara new user is database ko access and control kar sakta hai.

Iske liye aap ye command use kare.

mysql>GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost;

Ab hume privileges ko disk par flush karne ki jarurat hai taki humare MySQL ke current instance humare dwara kiye changes ke bare me jan sake.

mysql>FLUSH PRIVILEGES;

Ab hume MySQL se bahar aana hai. Iske liye ye command use kare.

mysql>EXIT;

Ab hum wapis main command prompt par pahuch jayenge.

2. Adjust Nginx Configuration to Handle WordPress

Ab hum aspne Nginx server block files me kuch minor adjustments karenge. Server files ko open karne ke liye command se pahle sudo ka istemal karna hai.

Ab default server block ko is command se open kare.

$sudo nano /etc/nginx/sites-available/default

Main server block ke bhitar hume kuch location blocks ko add karne ki jarurat hai.

Hum server par wordpress install karenge to server block isk isabhi requests ko save kar lega. Inhe save karne ki jarruat nahi hai so aap /favicon.ico and /robots.txt dono ko block kar de.

Iske liye aap niche btaye example me di lines ko server block me add kare. Ye line aapko server {…} ke under add karni hai.

/etc/nginx/sites-available/default
server {
    . . .

    location = /favicon.ico { log_not_found off; access_log off; }
    location = /robots.txt { log_not_found off; access_log off; allow all; }
    location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
        expires max;
        log_not_found off;
    }
    . . .
}

Ab location / block ke andar hume try_files ko adjust karne ki jarurat hai taki 404 error ko default option ke roop me wapas karne ki bajaye index.php request argument ke sath control kiya ja sake.

Iska look kuch is tarah ka hoga hona chahiye. Jo line add karni hai use me red color me add kar raha hu.

/etc/nginx/sites-available/default
server {
    . . .
    location / {
        # try_files $uri $uri/ =404;
        try_files $uri $uri/ /index.php$is_args$args;
    }
    . . .
}

Jab aap editing complete kar le to file save kar close kar de.

Ab hum is command se humare configuration errors ko check kar sakte hai.

$sudo nginx -t

Agar koi bhi error report na mile to is command se Nginx ko restart kare.

$sudo systemctl reload nginx

3. Install Additional PHP Extensions

Apne LEMP stock ko install karte time PHP ko MySQL ke sath communicate karne ke liye hume minimal extensions set karne ki jarurat hai. Inke bina kai wordpress plugins proper work nahi karte hai.

Yaha hum wordpress ki better performance ke liye kuch most popular PHP extensions ko download or install kar rahe hai.

$sudo apt update
$sudo apt install php-curl php-gd php-intl php-mbstring php-soap php-xml php-xmlrpc php-zip

Jab extensions installation finish ho jaye to PHP-FPM process ko restart karna hai taki running PHP processor newly installed features ko leverage kar sake.

PHP-FPM ko is command se restart kar sakte hai.

$sudo systemctl restart php7.2-fpm

4. Download WordPress

Ab humara server fully configure ho chuka hai. Ab hum is par WordPress download and set up kar sakte hai. Security reason se better hai ki aap humesha wordpress ka latest version download kare.

Aap is simple commands se wordpress download kar sakte hai.

$cd /tmp
$curl -O https://wordpress.org/latest.tar.gz

Ab wordpress structure directory banane ke liye file ko extract kare. File unzip karne ke liye ye command use kare.

$tar xzvf latest.tar.gz

Ab hum in files ko humare document root momentarily me move kar denge lekin isse pahle hum in files ko copy kar lenge kyuki wordpress inko read karta hai.

$cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php

Ab hume upgrade directory create karni hai taki wordpress ko run and update hone me permission issue ki problem na ho.

Is command se easily upgrade directory create kar sakte hai.

$mkdir /tmp/wordpress/wp-content/upgrade

Ab hum directory ke all data ko humare document root me copy kar sakte hai. Humari permission and maintained ko banaye rakhne ke liye hum -a flag use karenge. Source directory ke end me dot . use karenge taki directory ke under sabhi files and hidden files ko copy kiya ja sake.

$sudo cp -a /tmp/wordpress/. /var/www/html

5. Configure WordPress Directory

Web-based WordPress setup karne se pahle hume apni WordPress directory me kuch adjustments karne ki jarurat hai.

Adjusting the Ownership and Permissions

Hume ek aese web server ki jarurat hai jo proper work kare aur sabhi files and directories ko access and adjust kar sake.  Iske liye hum apne username ke liye humare directory root me all files par ownership over kar denge.

Default username root hota hai par LEMP tutorial me maine custom username choose karne ke liye kaha tha yaha hum apna custom username use karenge. Sath hi hum group ownership ko www-data se assign karenge.

$sudo chown -R root:www-data /var/www/html

Iske bad hum setgid har root directory ko document root ke bhitar set karenge. Iske karan www-data user ki primary group banane ki bajaye parent directory (jo humne set ki hai) ke group ko receive karne ke liye in directories me banayi gayi new files banti hai.

Hum is command se setgid type karke humare wordpress installation me har ek directory par bit set kar sakte hai.

$sudo find /var/www/html -type d -exec chmod g+s {} \;

Yaha par abhi kuch or permissions set karna jaruri hai. Sabse pahle hum wp-content access karenge taki hum theme and plugins change kar sake.

$sudo chmod g+w /var/www/html/wp-content

Isi process me hum web server ko in two directories me all content ko write karne ki permission denge.

$sudo chmod -R g+w /var/www/html/wp-content/themes
$sudo chmod -R g+w /var/www/html/wp-content/plugins

Ye reasonable permission ke sath set hona chahiye wanra kuch plugins ko extra changes ki jarurat padegi.

Setting up the WordPress Configuration File

Ab hume main WordPress configuration file me kuch badlav karne ki jarurat hai.

Jab hum file kholte hai to humare first business ka order humare installation ke liye kuch security provide karne ke liye secret keys adjust karne ke liye hoga.

WordPress in values ke liye secret generator provide karta hai taki aap apne khud ke good values ko try na kare. Ye only internally use hota hai isiliye ye secure hai or security ke liye better hai.

WordPress secret generator se keys pane ke liye ye command line use kare.

$curl -s https://api.wordpress.org/secret-key/1.1/salt/

Ab aapko kuch unique value milenge jinka look kuch aesa hoga.

/var/www/html/wp-config.php
define('AUTH_KEY', '1jl/vqfs<XhdXoAPz9 DO NOT COPY THESE VALUES c_j{iwqD^<+c9.k<J@4H');
define('SECURE_AUTH_KEY', 'E2Np+aS/p7X DO NOT COPY THESE VALUES {Ka(f;rv?Pxf})CgLi-3');
define('LOGGED_IN_KEY', 'W(50,{W^PB%PB<JF DO NOT COPY THESE VALUES 2;y&,2m%6DUth[;88');
define('NONCE_KEY', 'll,4UC)7ua+8<!4VM+ DO NOT COPY THESE VALUES #`DXF+[$atz7 o^-C7g');
define('AUTH_SALT', 'koMrurzOA+|L_lG}kf DO NOT COPY THESE VALUES 07VC*Lj*lD&?3w!BT#-');
define('SECURE_AUTH_SALT', 'p3%LZ+pAu:VY DO NOT COPY THESE VALUES C-?y+K0DK_|0h{!_xY');
define('LOGGED_IN_SALT', 'i^/G2WOQ+t$3 DO NOT COPY THESE VALUES t6**bRVFSD[Hi])-qS`|');
define('NONCE_SALT', 'Q6]U:K?j4L%Z]}yh^q7 DO NOT COPY THESE VALUES 1% ^qUswWgnxqHN&%');

Ye configuration line hai jo hume secure keys ko set karne ke liye direct humari wp configuration file me save karni hai. Aapko jo key lines prapt ho unhe copy kar notepad me save kar le.

Ab is command se WordPress configuration file ko open kare.

$nano /var/www/html/wp-config.php

Ab secret keys demo lines search kare. Demo keys ka look is type ka hoga.

/var/www/html/wp-config.php
. . .

define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');

. . .

Ab in demo secret keys lines ko hataye or apni generate ki secret lines ko yaha paste kare. I mean aapko inki jagah apni secret key add karni hai.

Important Warning: Aap apne khud ki secret ki generate kare or yaha di gayi keys lines ka istemal na kare.

Iske bad hume file ki starting me kuch database connection settings ko configure karne ki jarurat hai. I mean aapko database name, password, and username set karne ki jarurat hai.

Yaha aapko wohi database name, password or username set karne hai jo aapne MySQL ke andar database and user account create karte time set kiye the.

Iske alawa hume wordpress ko file system me write karne or themes plugins ko update karne ki permission deni hogi warna aap wordpress dashboard se plugins aur themes ko update karne par FTP error show hoga.

Main yaha wordpress configuration ki complete edited lines ke sath examle bta raha hu.

/var/www/html/wp-config.php
. . .

define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wordpressuser');

/** MySQL database password */
define('DB_PASSWORD', 'password');

. . .

define('FS_METHOD', 'direct');

Ise dekh kar configuration complete kare or jab sab theek se kar lo to file save kar band kar de.

6. Complete Installation through Web Interface

Ab jab server configuration complete ho gaya hai to hum web interface ke through installation ko finish kar sakte hai.

Apne web browser me apna ip address ya domain name type kar open kare.

$http://server_domain_or_IP

Ab us language ko select kare jisme aap wordpress use karna chahate hai.

WordPress Installation

Ab aap main setup par pahuch jayenge.

  1. Site title: Apni WordPress site ke liye ek name select kare
  2. Username: username set kare.
  3. Password: wp dashboard par log in karne ke liye password set kare.
  4. Your email: apna email address enter kare.
  5. Finally, Install WordPress button par click kare.

WordPress Welcome page

Ab aapne WordPress successfully install kar liya hai. Ab jo page khulega usme aapko log in karne ke liye kaha jayega. Aap upar set kiye gaye email address, username or password se log in kar sakte hai.

WordPress Installation Success

Ab aap WordPress dashboard par pahuch jaoge. Jiska look kuch aesa hoga.

WordPress Dashboard

Congratulations! ab aapne successfully apne server par wordpress install kar liya hai.

WordPress Upgrading

Abhi aap jab WordPress theme or plugins ko interface ke through update karoge to error show hoga or na hi aap theme files ko edit kar paoge. Iske liye aapko wordpress ko permission deni hogi jiske liye ye command line use kare.

$sudo chown -R www-data /var/www/html

WordPress ko update karne ke liye ye jaruri hai. Ab aapkoa wordpress blog use karne ke liye ready hai. Next time WordPress par log in karne ke liye aap http://example.com/wp-admin URL par ja kar sign in kar sakte hai.

Ye thi Ubuntu 18.04 server par LEMP ke sath WordPress install karne ki hindi jankari. I hope aapke liye ye helpful sabit hogi or aap asani se iske steps follow kar cloud server par WordPress install kar sakoge.

Ye bhi padhe,

Agar aapko ye jankari achhi lage to ise social media par apne friends or other people ke sath share jarur kare.

Avatar for Jumedeen Khan

About Jumedeen Khan

I'm the founder of this site and we regularly share useful and helpful information here for beginners. ❤️

Reader Interactions

Comments (12)

  1. Avatar for NeerajNeeraj

    Hello jumedeen bhai
    Mene apni website me Ubuntu 20.4 pr nginx se wordpress install ki h fir lets encrypt se ssl ab koi v page open kr rha hu to ssl warning show hoti h lock ki jagh reload krne pr sahi ho jati h please btaiye kya problem ho skti h

    • Avatar for Jumedeen KhanJumedeen Khan

      browser cache clear karke check karo.

  2. Avatar for आनंद कुमारआनंद कुमार

    जब मैं DO होस्टिंग पर इन्सटाल्ड अपने वर्डप्रेस ब्लॉग के पासवर्ड को रिसेट करना चाहता हूँ तो पहले Lost your password पर क्लिक करता हूँ. इसके बाद एक बॉक्स आता है जिसमें ईमेल आईडी डालकर Enter करता हूँ तो ये मेसेज आता है.
    The email could not be sent.
    Possible reason: your host may have disabled the mail() function.
    इसका समाधान किस तरह से हो सकता है?

    दूसरी बात ये कि आपके कमेंट फॉर्म में सिर्फ अल्फाबेटिकल कीज ही टाइप हो रहे हैं. बाकी कीज टाइप करने पर इमोजी टाइप के कंटेंट आ जाते हैं. एक बार आप खुद से इसको चेक करके इसका सोल्यूशन कर लीजियेगा.

    • Avatar for जुमेदीन खानजुमेदीन खान

      आप DO Support से कांटेक्ट करो वह ईमेल सर्विस इनेबल कर देंगे, थैंक यू बताने के लिए मैं इस issue को फिक्स कर लूंगा

      • Avatar for आनंद कुमारआनंद कुमार

        ओके, मैं जल्द ही कांटेक्ट करता हूँ.

  3. Avatar for WasimWasim

    Sir mujhe site hostgator se digital ocean me migrate karna chahta hum . Kya aap meri help karenge?

    • Avatar for Jumedeen khanJumedeen khan

      Yea, ask anything.

  4. Avatar for AbhishekAbhishek

    Sir EasyEngine bhi use kar sakte hain. Aap easyEngine recommend karenge ya nahi? Aapka landing page bahut hi khubsurat hai, aisa landing page kaise banayen?
    landing-page.php edit kar sakte hain?

    • Avatar for Jumedeen khanJumedeen khan

      Nahi, main manually server setup recommend karunga, google karo, genesis landing page ke kai tutorial mil jayenge.

  5. Avatar for Rakesh kumarRakesh kumar

    अच्छी जानकारी

  6. Avatar for pradeeppradeep

    धन्यवाद्; इस Article की मुझे बहुत दिनों से जरुरत थी ..जिसे मैंने Use कर अपने WP site अपग्रेड किया है…

    कृपया Lemp Server पर WP साइट Speed Boost करने का भी कोई तरीका/ Article बताये..
    After Upgradation—– ( GTmatrix में Performance Score- F(42%) and E(55%), Loaded Time- 8 Sec. , Page Size- 2 MB, Request- 72 show हो रहा है और PageSpeed Insights में Mobile – (55%) व Desktop- (39%) है..)

    Ubuntu 18.04 (with LEMP) में इसका कोई Configuration Rules/ WP Configuration हो, तो बताये…. #Jdk sir

    • Avatar for Jumedeen khanJumedeen khan

      Jaldi hi main, Nginx configuration for wordpress ka article share karunga.

Add a Comment

Your email address will not be published. Required fields are marked *

I need help with ...