{"id":47866,"date":"2024-06-27T15:32:19","date_gmt":"2024-06-27T08:32:19","guid":{"rendered":"https:\/\/www.rumahweb.com\/journal\/?p=47866"},"modified":"2024-06-27T15:32:20","modified_gmt":"2024-06-27T08:32:20","slug":"cara-install-docker-di-almalinux","status":"publish","type":"post","link":"https:\/\/www.rumahweb.com\/journal\/cara-install-docker-di-almalinux\/","title":{"rendered":"Cara Install Docker di AlmaLinux Pada VPS KVM"},"content":{"rendered":"\n<p>Setelah sebelumnya kami bahas tentang apa itu Docker, pada artikel ini, kami akan berbagi cara install docker di AlmaLinux pada layanan VPS KVM Rumahweb.<\/p>\n\n\n\n\n\n<p>Namun sebelum masuk ke materi install docker di AlmaLinux, terlebih dahulu akan kami ulas sedikit tentang apa itu Docker, untuk memudahkan Anda dalam memahami artikel yang kami buat. Simak informasi berikut ini. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Mengenal Docker<\/h2>\n\n\n\n<p>Docker adalah platform <em>open-source<\/em> yang memungkinkan <em>developer <\/em>untuk mengemas aplikasi beserta semua dependensinya ke dalam unit yang disebut sebagai <em>container<\/em>.<\/p>\n\n\n\n<p>Konsep utama docker adalah menyediakan lingkungan yang terisolasi (container) di mana aplikasi dapat berjalan dengan konsisten di berbagai lingkungan komputasi \/ os server Yang berbeda, termasuk server\u00a0 fisik, virtual compute, cloud, dan datacenter.\u00a0<\/p>\n\n\n\n<p>Selain itu, Docker dapat berjalan secara optimal dimanapun anda melakukan deploy. Selengkapnya tentang apa itu Docker, bisa Anda pelajari pada artikel: <strong><a href=\"https:\/\/blog.rumahweb.com\/docker-adalah\/\" target=\"_blank\" rel=\"noopener\" title=\"docker adalah\">Apa itu Docker?<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cara Install Docker di AlmaLinux <\/h2>\n\n\n\n<p>Dalam artikel ini, kami akan berbagi cara install docker di AlmaLinux 8 dengan menggunakan <a href=\"https:\/\/www.rumahweb.com\/vps-indonesia\/\" target=\"_blank\" rel=\"noopener\" title=\"vps indonesia\">VPS KVM<\/a> dari Rumahweb. Namun sebelumnya, pastikan VPS Anda telah memenuhi <em>system<\/em> <em>requirement <\/em>berikut.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1. Persiapan Sistem\u00a0<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>VPS KVM dengan OS AlmaLinux 8\u00a0<\/li>\n\n\n\n<li>RAM minimal 2GB dan CPU 2Core<\/li>\n\n\n\n<li>Akses Root<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2. Install Package Docker<\/h3>\n\n\n\n<p>Sebelum melakukan installasi docker, Anda perlu menginstall <em>package <\/em>dan <em>environment <\/em>terlebih dahulu untuk kebutuhan app docker. Anda bisa menggunakan perintah berikut:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># rpm --import https:\/\/repo.almalinux.org\/almalinux\/RPM-GPG-KEY-AlmaLinux\nyum update -y\n\n# sudo dnf --refresh update\n# sudo dnf upgrade\n# sudo dnf install yum-utils\n\n# yum install epel-relase<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/docsz\/AD_4nXf9H269VL1FasLlRlx-eIsIEEKFwnHSFNcZhJmPkFQvJR6K3VYzWMkH2i4R2jCTtbfmypAKmHDbpIkXvj3pxf0xkuYzI8FScxsg384ognOBBqi5P8Q8vee-Y9jyPvjFOV6FE0F1dICIyFoxydjbQ3RlgqJv?key=7Wqj400HPq64PeB07SxOhg\" alt=\"install package almalinux\"\/><\/figure>\n\n\n\n<p>Setelah menjalankan <em>update package<\/em>, tambahkan repository docker dengan perintah berikut:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># sudo dnf install -y yum-utils device-mapper-persistent-data lvm2\n\n# sudo yum-config-manager --add-repo https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/docsz\/AD_4nXeag_VeOw8mpAQRgKsBdne8y_fJ6QVZE-HTVzyICMpu3EZHUJeOwK_Y7w-JvfMqeIPvLA5LGJ34_ABEG2uXo-Lqrys2RQ9BStgaAnsWt5lE-Ycz3nNBDFQEXb6z-q5094cCpMIa84pYoKw3JKu8XgsmJkUF?key=7Wqj400HPq64PeB07SxOhg\" alt=\"add docker repo almalinux\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3. Install Docker<\/h3>\n\n\n\n<p>Apabila repo dan <em>package <\/em>docker telah ditambahkan, langkah selanjutnya adalah melakukan installasi docker dan menjalankan docker pada VM.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># sudo dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/docsz\/AD_4nXezO3Vigzfm6noOEZMAtkDawuuZhaomPXUEWySkjVWlDZhYFTyrgGIDEYdJXYp_ydbY8_-T3JTIcvAdAueoa3Khl_vDKSQzP-Kte-n9GHivI_PDgb1X3BXG-exwarun3hv172duhMuHacU18SeZDRM0mMIV?key=7Wqj400HPq64PeB07SxOhg\" alt=\"install docker almalinux\"\/><\/figure>\n\n\n\n<p>Sampai tahap ini, kita telah berhasil melakukan install docker di AlmaLinux 8. Langkah selanjutnya adalah memulai service docker agar dapat berjalan di VM.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># sudo systemctl start docker\n# sudo systemctl enable docker<\/code><\/pre>\n\n\n\n<p>Untuk memeriksa apakah docker telah berjalan di server, Anda perlu melakukan pemeriksaan menggunakan systemctl dengan perintah berikut:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># sudo systemctl status docker<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/docsz\/AD_4nXfag0p9wbd87UTpG7EcK3J2NojbIdbk7kkvyxmW7A-bRDt6-rGV0bgvJdrQ17cRyfjRCABJxFmBNO31vALLAdjCF6eSZSowrIHYDN5Exhs-wm8IYFk5UJboURnQGe8KlhUHdwrhruWStkveDarDzO-VMWzC?key=7Wqj400HPq64PeB07SxOhg\" alt=\"status docker linux\"\/><\/figure>\n\n\n\n<p>Dari screenshot diatas, Docker telah berhasil berjalan pada VPS. Sebelum digunakan, kita perlu mengatur permission pada docker agar dapat berjalan sebagai root. Gunakan perintah berikut:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># sudo usermod -aG docker root<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Pengujian Docker<\/h2>\n\n\n\n<p>Pengujian docker perlu dilakukan dan kali ini kita akan mencoba menggunakan basic <em>command <\/em>docker.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Cek versi docker<\/h3>\n\n\n\n<p>Anda bisa melakukan pengecekan versi pada Docker dengan menjalankan perintah: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-gridlove-acc-color\">docker &#8211;version<\/mark><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/docsz\/AD_4nXes8EmjhUlu_xUFevUHfNkiey0yxc7ad7bhrFUL2LhjEXvRsQzkYRO3tTNioq7vUSYQZGxIFk7-czA4uEudmaSbbqMw0J380PaKCahcslBrjYlEDDDC3Q-89Ksldi-rva1vHEyhYSAzHkUR1dvv8eBdI5Ev?key=7Wqj400HPq64PeB07SxOhg\" alt=\"docker version check\"\/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\">Menambahkan image<\/h3>\n\n\n\n<p>Untuk menambahkan image Docker, Anda bisa menggunakan perintah docker pull. Berikut adalah contoh perintah untuk mendownload image NGINX:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># docker pull nginx\u00a0<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/docsz\/AD_4nXcK7_TxVIV0RupvmaVHxQDQMcSQ3TBEltr53J7mr-PyxbdrIzZaDWPaSe54KT5ACpQKFshkglwBJxiXA41EOFvC9g60Pv00YR-hTLlwPNDM7x6XXXBeUX5aUYk9Ya3hKQQyEpOBZEVyBOAZfcvIHr5_Ueoo?key=7Wqj400HPq64PeB07SxOhg\" alt=\"pull image docker\"\/><\/figure>\n\n\n\n<p>Secara default, jika tidak mendeskripsikan versi, maka akan mendownload versi nginx terbaru\/latest. Untuk memeriksa image yang sudah terdownload, jalankan command : <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-gridlove-acc-color\">docker image ls<\/mark><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/docsz\/AD_4nXe_UrZGARjQtuko0JG3uIUl7OsgEHYrivYPXIS9DsSSan6RQ54UXirvduHEPdd4oW2OoEC5GyKt0dOa3SsTtcTsv1DyCnUF9k7eMmVcL--WDigc6KG41ygZApsQoWPdbgy3KluWfkTb9Kz6Sy_Zb95vsEvY?key=7Wqj400HPq64PeB07SxOhg\" alt=\"docker check image\"\/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Menjalankan Image<\/h2>\n\n\n\n<p>Untuk menjalankan image yang telah didownload, dapat menggunakan docker run<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># docker run --name mynginx -d -p 80:80 nginx<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/docsz\/AD_4nXdVgk3U2tmJL5ovuA57UU8WkI5KuEKblTcJYGcgVyBixLzMNFNtngjjl9zgtkw2LaQcrJvbyk4BhfGC7yTrmgt3w45R2aO8hPEBMINLzTmyP3pPTW07euu5DLe1s0favZ4-y9OfAz2jq5y8yHzSVJhHNNmH?key=7Wqj400HPq64PeB07SxOhg\" alt=\"create container docker\"\/><\/figure>\n<\/div>\n\n\n<p>Command diatas berarti menjalankan container image nginx, dengan memberi nama mynginx, dan aplikasi nginx berjalan di port 80, untuk memeriksa apakah container sudah berjalan, dapat menggunakan command docker ps<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/docsz\/AD_4nXfZmzq8NttJ389pkUEcp1vYEHSX_d0myocyKkM68ZtyR2bjPVmCtDGtCsOkIwvJfUFM-NxvB5gLnFoQoDRCl-QdQUIcsL2c9t8S1zKih7bjc6IIasZzim5clK4drEuclRn7bRVhzEm0bX8nC6kGDd-7BdMp?key=7Wqj400HPq64PeB07SxOhg\" alt=\"docker ps status\"\/><\/figure>\n\n\n\n<p>Nginx telah berjalan di port 80, dan dapat diakses melalui ip public.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/docsz\/AD_4nXdprIHkfU0cj21B_gNHRjEkUcHmJPXKIZSzrACbVUyGqvEj6cHzgRDcbJZvtAW1GCAwxYt3tRbtGL0ewPef0UfZL4HWf8l70c8oAbtOJaSUgRG9_Jx0aykyK1e6wJ4vehqJHGe4tIVszu6KFqBNn7LB3dCS?key=7Wqj400HPq64PeB07SxOhg\" alt=\"hasil docker nginx - cara install docker di almalinux 8\"\/><\/figure>\n\n\n\n<p>Bagi Anda yang menggunakan OS Ubuntu, install Docker juga bisa Anda pelajari pada artikel berikut: <a href=\"https:\/\/www.rumahweb.com\/journal\/cara-install-docker-di-ubuntu\/\" target=\"_blank\" rel=\"noopener\" title=\"\">install docker Ubuntu<\/a><\/p>\n\n\n\n<p>Demikian panduan mengenai installasi Docker pada os AlmaLinux 8, Semoga artikel ini dapat membantu untuk belajar tentang Docker.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setelah sebelumnya kami bahas tentang apa itu Docker, pada artikel ini, kami akan berbagi cara install docker di AlmaLinux pada layanan VPS KVM Rumahweb. Namun sebelum masuk ke materi install docker di AlmaLinux, terlebih dahulu akan kami ulas sedikit tentang apa itu Docker, untuk memudahkan Anda dalam memahami artikel yang kami buat. Simak informasi berikut [&hellip;]<\/p>\n","protected":false},"author":349,"featured_media":48045,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[177],"tags":[1992,1119,321],"class_list":{"0":"post-47866","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-vps","8":"tag-almalinux","9":"tag-docker","10":"tag-vps"},"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.rumahweb.com\/journal\/wp-content\/uploads\/2024\/06\/Cara-Install-Docker-di-AlmaLinux.png","jetpack_shortlink":"https:\/\/wp.me\/p8n3G7-cs2","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.rumahweb.com\/journal\/wp-json\/wp\/v2\/posts\/47866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rumahweb.com\/journal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rumahweb.com\/journal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rumahweb.com\/journal\/wp-json\/wp\/v2\/users\/349"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rumahweb.com\/journal\/wp-json\/wp\/v2\/comments?post=47866"}],"version-history":[{"count":0,"href":"https:\/\/www.rumahweb.com\/journal\/wp-json\/wp\/v2\/posts\/47866\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rumahweb.com\/journal\/wp-json\/wp\/v2\/media\/48045"}],"wp:attachment":[{"href":"https:\/\/www.rumahweb.com\/journal\/wp-json\/wp\/v2\/media?parent=47866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rumahweb.com\/journal\/wp-json\/wp\/v2\/categories?post=47866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rumahweb.com\/journal\/wp-json\/wp\/v2\/tags?post=47866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}