# Python

# multiple Python versions on Ubuntu

<div class="Y3BBE" data-hveid="CAEQAA" data-processed="true" data-sfc-cp="" id="bkmrk-you-can-install-and-" jsaction="rcuQ6b:&HNj2ye_8|npT2md" jscontroller="zcfIf" jsuid="HNj2ye_8" style="font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin-block: 12px 16px; color: rgb(10, 10, 10); margin-inline: 0px; margin-top: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">You can install and manage multiple Python versions on Ubuntu <mark class="HxTRcb" data-processed="true" style="color: rgb(0, 29, 53); border-radius: 4px; background: linear-gradient(90deg, rgb(211, 227, 253) 50%, rgba(0, 0, 0, 0) 50%) 75% 0px / 200% 100% no-repeat scroll padding-box border-box rgba(0, 0, 0, 0); padding: 0px 2px; font-weight: 500; animation: 0.75s cubic-bezier(0.05, 0.7, 0.1, 1) 0.25s 1 normal forwards running highlight-animation;">using the **`pyenv` tool** or by using the **Deadsnakes PPA** (Personal Package Archive) with</mark> `apt`. The `pyenv` method is generally recommended as it is safer and user-level, while the PPA method is good for system-wide access.<span class="uJ19be notranslate" data-processed="true" data-wiz-uids="HNj2ye_h"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=HNj2ye_g/TKHnVd" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="d9890951-1d5a-4ec7-b4d3-de73b1af64d1" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQye0OegQIARAC" data-wiz-attrbind="disabled=HNj2ye_g/C5gNJc;aria-label=HNj2ye_g/bOjMyf;class=HNj2ye_g/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Fsg96" data-processed="true" data-sfc-cp="" id="bkmrk-" jsaction="rcuQ6b:&HNj2ye_k|npT2md" jscontroller="KHhJQ" jsuid="HNj2ye_k" style="color: rgb(10, 10, 10); font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" id="bkmrk-method-1%3A-using%C2%A0pyen" jscontroller="a7qCn" jsuid="HNj2ye_l" role="heading" style="margin-block: 24px 12px; color: rgb(0, 29, 53); font-family: 'Google Sans', Arial, sans-serif; font-size: 20px; line-height: 28px; font-weight: 600; margin-inline: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Method 1: Using `pyenv` (Recommended for development)<span class="txxDge notranslate" data-processed="true" data-wiz-uids="HNj2ye_o" style="visibility: hidden;"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=HNj2ye_n/TKHnVd" style="white-space: nowrap; position: relative;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="d158a4b9-7fcc-47cc-a7be-58d683c1dd71" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQye0OegQIAhAA" data-wiz-attrbind="disabled=HNj2ye_n/C5gNJc;aria-label=HNj2ye_n/bOjMyf;class=HNj2ye_n/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Y3BBE" data-hveid="CAMQAA" data-processed="true" data-sfc-cp="" id="bkmrk-pyenv%C2%A0allows-you-to-" jsaction="rcuQ6b:&HNj2ye_p|npT2md" jscontroller="zcfIf" jsuid="HNj2ye_p" style="font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin-block: 12px 16px; color: rgb(10, 10, 10); margin-inline: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">`pyenv` allows you to manage multiple Python versions and switch between them easily without affecting the system's default Python installation.<span class="uJ19be notranslate" data-processed="true" data-wiz-uids="HNj2ye_s"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=HNj2ye_r/TKHnVd" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="18c2cde2-73eb-4dbb-ba38-60efb1db674c" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQye0OegQIAxAB" data-wiz-attrbind="disabled=HNj2ye_r/C5gNJc;aria-label=HNj2ye_r/bOjMyf;class=HNj2ye_r/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div>1. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Install system dependencies:** These packages are necessary to build Python from source, which `pyenv` does.</span><div class="r1PmQe" data-hveid="CAYQAQ" data-processed="true" data-wiz-uids="HNj2ye_2o,HNj2ye_2p,HNj2ye_2q" jscontroller="HP6Sjf" jsuid="HNj2ye_2n" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQopQPegQIBhAC" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="HNj2ye_2r" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    sudo apt update
    sudo apt install git curl make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl
    
    ```
2. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Install `pyenv`:** Run the automatic installer script provided by `pyenv`.</span><div class="r1PmQe" data-hveid="CAYQBA" data-processed="true" data-wiz-uids="HNj2ye_2z,HNj2ye_30,HNj2ye_31" jscontroller="HP6Sjf" jsuid="HNj2ye_2y" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQopQPegQIBhAF" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="HNj2ye_32" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    curl https://pyenv.run | bash
    
    ```
3. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Configure your shell environment:** Add the following lines to your `~/.bashrc` (or `~/.zshrc` if you use Zsh) file to ensure `pyenv` loads correctly.</span><div class="r1PmQe" data-hveid="CAYQBw" data-processed="true" data-wiz-uids="HNj2ye_3b,HNj2ye_3c,HNj2ye_3d" jscontroller="HP6Sjf" jsuid="HNj2ye_3a" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQopQPegQIBhAI" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="HNj2ye_3e" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
    echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
    echo 'eval "$(pyenv init -)"' >> ~/.bashrc
    
    ```
4. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Reload your shell:** Close and reopen your terminal, or run the following command to apply the changes to your current session:</span><div class="r1PmQe" data-hveid="CAYQCg" data-processed="true" data-wiz-uids="HNj2ye_3k,HNj2ye_3l,HNj2ye_3m" jscontroller="HP6Sjf" jsuid="HNj2ye_3j" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQopQPegQIBhAL" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="HNj2ye_3n" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    source ~/.bashrc
    
    ```
5. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Install desired Python versions:** Now you can install specific Python versions using `pyenv`. For example, to install Python 3.8.0 and 3.12.0:</span><div class="r1PmQe" data-hveid="CAYQDQ" data-processed="true" data-wiz-uids="HNj2ye_3u,HNj2ye_3v,HNj2ye_3w" jscontroller="HP6Sjf" jsuid="HNj2ye_3t" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQopQPegQIBhAO" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="HNj2ye_3x" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    pyenv install 3.8.0
    pyenv install 3.12.0
    
    ```
6. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Switch between versions:**</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">To set a global default for your user: `pyenv global 3.12.0`.</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">To set a local version for a specific project directory: `pyenv local 3.8.0`.</span><span class="uJ19be notranslate" data-processed="true" data-wiz-uids="HNj2ye_4a"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=HNj2ye_49/TKHnVd" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="f7435def-4f62-4575-90e8-c61f19c66304" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQye0OegQIBhAS" data-wiz-attrbind="disabled=HNj2ye_49/C5gNJc;aria-label=HNj2ye_49/bOjMyf;class=HNj2ye_49/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span>

<div class="Fsg96" data-processed="true" data-sfc-cp="" id="bkmrk--1" jsaction="rcuQ6b:&HNj2ye_4d|npT2md" jscontroller="KHhJQ" jsuid="HNj2ye_4d" style="color: rgb(10, 10, 10); font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" id="bkmrk-method-2%3A-using-the-" jscontroller="a7qCn" jsuid="HNj2ye_4e" role="heading" style="margin-block: 24px 12px; color: rgb(0, 29, 53); font-family: 'Google Sans', Arial, sans-serif; font-size: 20px; line-height: 28px; font-weight: 600; margin-inline: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Method 2: Using the Deadsnakes PPA (System-wide installation)<span class="uJ19be notranslate" data-processed="true" data-wiz-uids="HNj2ye_4g"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=HNj2ye_4f/TKHnVd" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="eeea034e-9f5b-40ad-9092-168b96efa715" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQye0OegQIBxAA" data-wiz-attrbind="disabled=HNj2ye_4f/C5gNJc;aria-label=HNj2ye_4f/bOjMyf;class=HNj2ye_4f/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Y3BBE" data-hveid="CAgQAA" data-processed="true" data-sfc-cp="" id="bkmrk-the-deadsnakes-ppa-o" jsaction="rcuQ6b:&HNj2ye_4h|npT2md" jscontroller="zcfIf" jsuid="HNj2ye_4h" style="font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin-block: 12px 16px; color: rgb(10, 10, 10); margin-inline: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The Deadsnakes PPA offers various Python versions packaged for Ubuntu, allowing installation via `apt` without manually compiling from source. This method installs Python versions system-wide.<span class="uJ19be notranslate" data-processed="true" data-wiz-uids="HNj2ye_4k"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=HNj2ye_4j/TKHnVd" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="bf06f7f6-f4e5-4d4d-a3da-ab813df642af" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQye0OegQICBAB" data-wiz-attrbind="disabled=HNj2ye_4j/C5gNJc;aria-label=HNj2ye_4j/bOjMyf;class=HNj2ye_4j/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div>1. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Add the Deadsnakes PPA:**</span><div class="r1PmQe" data-hveid="CAkQAQ" data-processed="true" data-wiz-uids="HNj2ye_4r,HNj2ye_4s,HNj2ye_4t" jscontroller="HP6Sjf" jsuid="HNj2ye_4q" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQopQPegQICRAC" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="HNj2ye_4u" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    sudo add-apt-repository ppa:deadsnakes/ppa
    sudo apt update
    
    ```
2. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Install specific Python versions:** Install the desired versions (e.g., Python 3.8 and 3.12).</span><div class="r1PmQe" data-hveid="CAkQBA" data-processed="true" data-wiz-uids="HNj2ye_50,HNj2ye_51,HNj2ye_52" jscontroller="HP6Sjf" jsuid="HNj2ye_4z" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQopQPegQICRAF" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="HNj2ye_53" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    sudo apt install python3.8
    sudo apt install python3.12
    
    ```
3. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Verify installations:** The executables will be available as `python3.8` and `python3.12`.</span><div class="r1PmQe" data-hveid="CAkQBw" data-processed="true" data-wiz-uids="HNj2ye_5b,HNj2ye_5c,HNj2ye_5d" jscontroller="HP6Sjf" jsuid="HNj2ye_5a" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQopQPegQICRAI" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="HNj2ye_5e" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    python3.8 --version
    python3.12 --version
    
    ```
4. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Install `pip` for each version:** `pip` must be installed separately for each version.</span><div class="r1PmQe" data-hveid="CAkQCg" data-processed="true" data-wiz-uids="HNj2ye_5m,HNj2ye_5n,HNj2ye_5o" jscontroller="HP6Sjf" jsuid="HNj2ye_5l" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQopQPegQICRAL" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="HNj2ye_5p" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    sudo apt install python3.8-distutils # Install distutils first if needed
    curl -sS https://bootstrap.pypa.io/get-pip.py | python3.8
    
    sudo apt install python3.12-distutils # Install distutils first if needed
    curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12
    
    ```
    
    <span class="uJ19be notranslate" data-processed="true" data-wiz-uids="HNj2ye_5s"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=HNj2ye_5r/TKHnVd" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="b401a98b-7d0f-4a33-bda5-0b5e865daba8" data-processed="true" data-ved="2ahUKEwjrkoGoxqiSAxWeRmwGHYpvINoQye0OegQICRAM" data-wiz-attrbind="disabled=HNj2ye_5r/C5gNJc;aria-label=HNj2ye_5r/bOjMyf;class=HNj2ye_5r/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span>

<div class="Y3BBE" data-hveid="CAoQAA" data-processed="true" data-sfc-cp="" id="bkmrk-important-note%3A%C2%A0avoi" jsaction="rcuQ6b:&HNj2ye_5t|npT2md" jscontroller="zcfIf" jsuid="HNj2ye_5t" style="font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin-block: 12px 16px; color: rgb(10, 10, 10); margin-inline: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">**Important Note:** Avoid modifying the default system Python symlink (`/usr/bin/python3`) directly, as system tools rely on it and changing it can cause your operating system to break. The methods above allow different versions to coexist safely. For project-specific dependencies, always use Python virtual environments</div>

# installing masonite on ubuntu 24

<div class="Y3BBE" data-hveid="CAEQAA" data-processed="true" data-sfc-cp="" id="bkmrk-installing-the-mason" jsaction="rcuQ6b:&GktuLd_8|npT2md" jscontroller="zcfIf" jsuid="GktuLd_8" style="font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin-block: 12px 16px; color: rgb(10, 10, 10); margin-inline: 0px; margin-top: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Installing the Masonite framework on Ubuntu 24.04 involves setting up Python dependencies, creating a virtual environment, and installing the framework using `pip`.<span class="uJ19be notranslate" data-processed="true" data-wiz-uids="GktuLd_c"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=GktuLd_b/TKHnVd" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="8e54a627-3fcd-4196-af33-2ad4add5f06e" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQye0OegQIARAB" data-wiz-attrbind="disabled=GktuLd_b/C5gNJc;aria-label=GktuLd_b/bOjMyf;class=GktuLd_b/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Fsg96" data-processed="true" data-sfc-cp="" id="bkmrk-" jsaction="rcuQ6b:&GktuLd_d|npT2md" jscontroller="KHhJQ" jsuid="GktuLd_d" style="color: rgb(10, 10, 10); font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" id="bkmrk-prerequisites" jscontroller="a7qCn" jsuid="GktuLd_e" role="heading" style="margin-block: 24px 12px; color: rgb(0, 29, 53); font-family: 'Google Sans', Arial, sans-serif; font-size: 20px; line-height: 28px; font-weight: 600; margin-inline: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Prerequisites<span class="txxDge notranslate" data-processed="true" data-wiz-uids="GktuLd_g" style="visibility: hidden;"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=GktuLd_f/TKHnVd" style="white-space: nowrap; position: relative;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="496d1a40-5f4e-4e92-a38f-a027e16a5160" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQye0OegQIAhAA" data-wiz-attrbind="disabled=GktuLd_f/C5gNJc;aria-label=GktuLd_f/bOjMyf;class=GktuLd_f/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Y3BBE" data-hveid="CAMQAA" data-processed="true" data-sfc-cp="" id="bkmrk-before-installing%2C-e" jsaction="rcuQ6b:&GktuLd_h|npT2md" jscontroller="zcfIf" jsuid="GktuLd_h" style="font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin-block: 12px 16px; color: rgb(10, 10, 10); margin-inline: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Before installing, ensure your Ubuntu system is updated and has the necessary development tools, Python, and `pip` installed.<span class="uJ19be notranslate" data-processed="true" data-wiz-uids="GktuLd_k"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=GktuLd_j/TKHnVd" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="57813927-58ae-4bd4-ad76-0c800fda7118" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQye0OegQIAxAB" data-wiz-attrbind="disabled=GktuLd_j/C5gNJc;aria-label=GktuLd_j/bOjMyf;class=GktuLd_j/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Fsg96" data-processed="true" data-sfc-cp="" id="bkmrk--1" jsaction="rcuQ6b:&GktuLd_m|npT2md" jscontroller="KHhJQ" jsuid="GktuLd_m" style="color: rgb(10, 10, 10); font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">  
</div><div class="r1PmQe" data-hveid="CAQQAA" data-processed="true" data-wiz-uids="GktuLd_o,GktuLd_p,GktuLd_q" id="bkmrk-bash" jscontroller="HP6Sjf" jsuid="GktuLd_n" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQopQPegQIBBAB" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="GktuLd_r" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
sudo apt update
sudo apt install python3-dev python3-pip libssl-dev build-essential python3-venv

```

<div class="Fsg96" data-processed="true" data-sfc-cp="" id="bkmrk--2" jsaction="rcuQ6b:&GktuLd_t|npT2md" jscontroller="KHhJQ" jsuid="GktuLd_t" style="color: rgb(10, 10, 10); font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" id="bkmrk-installation-steps" jscontroller="a7qCn" jsuid="GktuLd_u" role="heading" style="margin-block: 24px 12px; color: rgb(0, 29, 53); font-family: 'Google Sans', Arial, sans-serif; font-size: 20px; line-height: 28px; font-weight: 600; margin-inline: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Installation Steps<span class="txxDge notranslate" data-processed="true" data-wiz-uids="GktuLd_w" style="visibility: hidden;"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=GktuLd_v/TKHnVd" style="white-space: nowrap; position: relative;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="adde4407-2bb6-4eb3-a938-b362f62acb14" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQye0OegQIBRAA" data-wiz-attrbind="disabled=GktuLd_v/C5gNJc;aria-label=GktuLd_v/bOjMyf;class=GktuLd_v/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div>1. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Create a Project Directory**  
    Navigate to the directory where you want to store your project:</span><div class="r1PmQe" data-hveid="CAgQAQ" data-processed="true" data-wiz-uids="GktuLd_2s,GktuLd_2t,GktuLd_2u" jscontroller="HP6Sjf" jsuid="GktuLd_2r" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQopQPegQICBAC" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="GktuLd_2v" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    mkdir ~/myapp
    cd ~/myapp
    
    ```
2. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Set Up a Virtual Environment (Recommended)**  
    Create and activate a virtual environment to avoid conflicts with system-wide packages:</span><div class="r1PmQe" data-hveid="CAgQBA" data-processed="true" data-wiz-uids="GktuLd_32,GktuLd_33,GktuLd_34" jscontroller="HP6Sjf" jsuid="GktuLd_31" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQopQPegQICBAF" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="GktuLd_35" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    python3 -m venv venv
    source venv/bin/activate
    
    ```
3. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Install Masonite**  
    Install the core Masonite framework:</span><div class="r1PmQe" data-hveid="CAgQBw" data-processed="true" data-wiz-uids="GktuLd_3c,GktuLd_3d,GktuLd_3e" jscontroller="HP6Sjf" jsuid="GktuLd_3b" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQopQPegQICBAI" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="GktuLd_3f" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    pip install masonite
    
    ```
4. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Create a New Project**  
    Initialize a new Masonite project in the current directory:</span><div class="r1PmQe" data-hveid="CAgQCg" data-processed="true" data-wiz-uids="GktuLd_3m,GktuLd_3n,GktuLd_3o" jscontroller="HP6Sjf" jsuid="GktuLd_3l" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQopQPegQICBAL" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="GktuLd_3p" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    craft new
    # or to specify a name
    # project start my_project
    
    ```
5. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Install Project Dependencies**  
    Install the dependencies listed in your project's `requirements.txt` file:</span><div class="r1PmQe" data-hveid="CAgQDQ" data-processed="true" data-wiz-uids="GktuLd_3x,GktuLd_3y,GktuLd_3z" jscontroller="HP6Sjf" jsuid="GktuLd_3w" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQopQPegQICBAO" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="GktuLd_40" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    pip install -r requirements.txt
    # Alternatively, if you used 'project start'
    # project install
    
    ```
6. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Run the Server**  
    Start the development server to confirm installation:</span><div class="r1PmQe" data-hveid="CAgQEA" data-processed="true" data-wiz-uids="GktuLd_47,GktuLd_48,GktuLd_49" jscontroller="HP6Sjf" jsuid="GktuLd_46" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQopQPegQICBAR" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="GktuLd_4a" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
    python craft serve
    
    ```
    
    <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">Access your application at `http://localhost:8000/`.</span><span class="uJ19be notranslate" data-processed="true" data-wiz-uids="GktuLd_4f"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=GktuLd_4e/TKHnVd" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="62cfcebe-2c49-4e41-91b4-a2623573533c" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQye0OegQICBAS" data-wiz-attrbind="disabled=GktuLd_4e/C5gNJc;aria-label=GktuLd_4e/bOjMyf;class=GktuLd_4e/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span>

<div class="Fsg96" data-processed="true" data-sfc-cp="" id="bkmrk--3" jsaction="rcuQ6b:&GktuLd_4j|npT2md" jscontroller="KHhJQ" jsuid="GktuLd_4j" style="color: rgb(10, 10, 10); font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" id="bkmrk-troubleshooting" jscontroller="a7qCn" jsuid="GktuLd_4k" role="heading" style="margin-block: 24px 12px; color: rgb(0, 29, 53); font-family: 'Google Sans', Arial, sans-serif; font-size: 20px; line-height: 28px; font-weight: 600; margin-inline: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Troubleshooting<span class="txxDge notranslate" data-processed="true" data-wiz-uids="GktuLd_4m" style="visibility: hidden;"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=GktuLd_4l/TKHnVd" style="white-space: nowrap; position: relative;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="e8425bac-7ed3-4790-85c7-896e9bf3b647" data-processed="true" data-ved="2ahUKEwigsbeyxKiSAxWeRmwGHYpvINoQye0OegQICRAA" data-wiz-attrbind="disabled=GktuLd_4l/C5gNJc;aria-label=GktuLd_4l/bOjMyf;class=GktuLd_4l/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div>- <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Command `craft` not found:** If the `craft` command is not recognized, ensure you are in the virtual environment. Alternatively, try running it with `python craft serve`.</span>
- <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Permission Errors:** If you did not use a virtual environment, use the `--user` flag: `pip install masonite --user`</span>

# Running a Python Masonite application in aaPanel

<div class="Y3BBE" data-hveid="CAEQAA" data-processed="true" data-sfc-cp="" id="bkmrk-running-a-python-mas" jsaction="rcuQ6b:&pWkg6b_8|npT2md" jscontroller="zcfIf" jsuid="pWkg6b_8" style="font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin-block: 12px 16px; color: rgb(10, 10, 10); margin-inline: 0px; margin-top: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Running a Python Masonite application in aaPanel involves installing the Python manager, setting up a virtual environment, installing dependencies, and configuring a WSGI server (like Gunicorn) behind Nginx. Use the "Python Project" management feature in aaPanel to handle the environment, dependencies, and reverse proxy configuration seamlessly.<span class="uJ19be notranslate" data-wiz-uids="pWkg6b_b"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=pWkg6b_a/TKHnVd" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="77d12912-f0ad-420c-b5de-2a240ea44710" data-ved="2ahUKEwj5_9qJyamSAxVf-DgGHStmFsgQye0OegQIARAB" data-wiz-attrbind="disabled=pWkg6b_a/C5gNJc;aria-label=pWkg6b_a/bOjMyf;class=pWkg6b_a/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Fsg96" data-processed="true" data-sfc-cp="" id="bkmrk-" jsaction="rcuQ6b:&pWkg6b_e|npT2md" jscontroller="KHhJQ" jsuid="pWkg6b_e" style="color: rgb(10, 10, 10); font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" id="bkmrk-step-by-step-deploym" jscontroller="a7qCn" jsuid="pWkg6b_f" role="heading" style="margin-block: 24px 12px; color: rgb(0, 29, 53); font-family: 'Google Sans', Arial, sans-serif; font-size: 20px; line-height: 28px; font-weight: 600; margin-inline: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Step-by-Step Deployment Guide<span class="txxDge notranslate" data-processed="true" data-wiz-uids="pWkg6b_h" style="visibility: hidden;"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=pWkg6b_g/TKHnVd" style="white-space: nowrap; position: relative;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="44e83416-cb81-482d-a65a-1f6ae65e4b1a" data-processed="true" data-ved="2ahUKEwj5_9qJyamSAxVf-DgGHStmFsgQye0OegQIAhAA" data-wiz-attrbind="disabled=pWkg6b_g/C5gNJc;aria-label=pWkg6b_g/bOjMyf;class=pWkg6b_g/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div>1. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Install Python Manager:**</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">Log in to aaPanel.</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">Go to **Software Store**, find **Python Project Manager**, and install it.</span>
2. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Upload Project Files:**</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">Use the aaPanel **File Manager** to upload your Masonite project files to a directory (e.g., `/www/wwwroot/masonite-app`).</span>
3. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Configure Project in Python Manager:**</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">Open **Python Project Manager**.</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">Click **Add Project**.</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Project Name:** Enter a name.</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Path:** Select the folder where you uploaded the Masonite app.</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Python Version:** Select Python 3.8+ (recommended for Masonite).</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Framework:** Choose "Masonite" (or "Flask/WSGI" if Masonite isn't listed, as it's WSGI compatible).</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Startup File/Script:** Point to `wsgi.py` (usually `app/wsgi.py` or similar).</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Port:** Set a port (e.g., 8000).</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Select "Install Dependencies"** to install from `requirements.txt`.</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">Ensure **Binding Domain** is filled to map your domain to the app.</span>
4. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Configure Environment Variables &amp; Database:**</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">In the project settings in the Python Manager, ensure the `.env` file is configured correctly for your database (MySQL/PostgreSQL) and that the `APP_URL` matches your domain.</span>
5. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Run Migrations &amp; Start:**</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">Use the terminal in aaPanel or the command line in the project manager to run Masonite commands:</span><div class="r1PmQe" data-hveid="CAUQFA" data-processed="true" data-wiz-uids="pWkg6b_3w,pWkg6b_3x,pWkg6b_3y" jscontroller="HP6Sjf" jsuid="pWkg6b_3v" style="margin-block: 24px 32px; font-family: 'Google Sans', Arial, sans-serif; color: rgb(0, 29, 53); font-weight: 400;"><div data-processed="true"><div class="pHpOfb" data-animation-atomic="" data-processed="true" style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); border-image: none 100% / 1 / 0 stretch; border-radius: 8px; overflow: hidden; padding: 0px; color: rgb(10, 10, 10); border: 1.2px solid rgb(169, 172, 170);"><div class="vVRw1d" data-processed="true" style="font-weight: 500; font-size: 20px; line-height: 26px; background-color: rgb(229, 237, 255); height: 34px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid rgb(169, 172, 170); padding: 0px 4px 0px 16px;">bash<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-processed="true" data-ved="2ahUKEwj5_9qJyamSAxVf-DgGHStmFsgQopQPegQIBRAV" style="margin: 0px; background: none; color: rgb(5, 40, 97); border: none; padding: 4px; font: inherit; outline: 0px; cursor: pointer;"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="pWkg6b_3z" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" data-processed="true" dir="ltr" style="unicode-bidi: isolate; font-size: 14px; line-height: 22px; overflow-x: auto; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(245, 248, 255, 0.5); padding: 2px 16px;"></div></div></div></div>```
        craft migrate
        
        ```
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">Restart the application in the Python Manager to apply changes.</span>
6. <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">**Setup Nginx Reverse Proxy:**</span>
    - <span class="T286Pc" data-processed="true" data-sfc-cp="" style="overflow-wrap: break-word;">The Python Manager should automatically create an Nginx configuration that proxies requests from port 80/443 to your Python app port (e.g., 8000).</span><span class="uJ19be notranslate" data-processed="true" data-wiz-uids="pWkg6b_4a"><span class="vKEkVd" data-animation-atomic="" data-processed="true" data-wiz-attrbind="class=pWkg6b_49/TKHnVd" style="white-space: nowrap; position: relative;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="c5b07f4b-bf03-41ea-a600-cfaf1ee78da2" data-processed="true" data-ved="2ahUKEwj5_9qJyamSAxVf-DgGHStmFsgQye0OegQIBRAZ" data-wiz-attrbind="disabled=pWkg6b_49/C5gNJc;aria-label=pWkg6b_49/bOjMyf;class=pWkg6b_49/UpSNec" style="margin: 0px 6px 0px 0px; background-color: rgb(229, 237, 255); border: none; border-radius: 10px; height: 20px; padding: 0px; width: 28px; position: relative; outline: 0px; cursor: pointer;" tabindex="0"><span class="wiMplc ofC0Ud" data-processed="true" style="color: rgb(0, 29, 53); display: inline-block; transform: rotate(135deg);"><svg fill="currentColor" focusable="false" height="12px" style="margin-top: 3px;" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span>

<div class="Y3BBE" data-hveid="CAYQAA" data-processed="true" data-sfc-cp="" id="bkmrk-if-the-app-fails-to-" jsaction="rcuQ6b:&pWkg6b_4d|npT2md" jscontroller="zcfIf" jsuid="pWkg6b_4d" style="font-family: 'Google Sans', Arial, sans-serif; font-size: 16px; line-height: 24px; overflow-wrap: break-word; margin-block: 12px 16px; color: rgb(10, 10, 10); margin-inline: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">If the app fails to start, check the logs in the Python Project Manager to resolve dependency or environment issues</div>

# Creating new masonite project using python 3.8.5

**First confirm the version**  
  
/www/server/python\_manager/versions/3.8.5/bin/python3 --version

**Setup the python 3.8.5 virtual environment**

/www/server/python\_manager/versions/3.8.5/bin/python3 -m venv &lt;environmentname&gt;

**Activate the envronment**

source &lt;environmentname&gt;/bin/activate

**Install the core Masonite framework**

pip install masonite

**Create your project**   
project start &lt;projectfoldername&gt;  
cd &lt;projectfoldername&gt;  
project install

**Run your project**

python craft serve

You can create this in the same way by switching to another Python version available on your system.

# Deploying a Masonite Application on aaPanel Using Gunicorn and tmux

Deploying a Masonite application on a VPS managed with **aaPanel** is straightforward when done step by step. This guide walks you through setting up your environment, running Masonite with **Gunicorn**, and keeping the application alive using **tmux**, along with configuring a reverse proxy in aaPanel.

---

## Step 1: Create a Static Website (MySQL Optional)

Start by creating a **static website** in aaPanel.  
If your Masonite project requires a database, you may also create a **MySQL database** at this stage. Otherwise, MySQL is optional.

This step mainly helps aaPanel manage the domain and web root.

---

## Step 2: Remove the Default `index.html`

After the site is created, navigate to the website’s root directory and remove the default `index.html` file created by aaPanel.  
This ensures it does not conflict with your Masonite application.

---

## Step 3: Upload Your Masonite Project Files

Upload all your **Masonite project files** into the website directory using FTP, SFTP, or the aaPanel file manager.

Make sure your project structure is intact, including the `wsgi.py` (or equivalent) entry file.

---

## Step 4: Install tmux from aaPanel Terminal

Open the **aaPanel Terminal** and switch to the **Super User (root) shell**.  
Install `tmux`, which will help keep Gunicorn running even after you close the terminal.

<div class="contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary" id="bkmrk-yum-install-tmux--y-"><div class="sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">`yum install tmux -y<span class="hljs-comment"># or (for Ubuntu/Debian)</span>apt install tmux -y`</div></div>---

## Step 5: Navigate to Your Project Folder

Still in the super user shell, move to your Masonite project directory:

<div class="contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary" id="bkmrk-cd-%2Fwww%2Fwwwroot%2Fyour"><div class="sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-built_in">cd</span> /www/wwwroot/your-domain.com`</div></div>---

## Step 6: Initialize Python 3.11.4 Environment

Initialize and activate a **Python 3.11.4 virtual environment** for your project.

> Refer to previously [Creating new masonite project using python 3.8.5](https://articles.ravapps.com/books/python/page/creating-new-masonite-project-using-python-385) for setting up Python 3.11.4 virtual environment.

Once activated, ensure Python and pip are pointing to the correct environment.

---

## Step 7: Install Gunicorn

With the virtual environment active, install Gunicorn:

<div class="contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary" id="bkmrk-pip-install-gunicorn"><div class="sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">`pip install gunicorn`</div></div>Gunicorn will act as the WSGI server for your Masonite application.

---

## Step 8: Run Gunicorn

Start your Masonite application using the following command:

<div class="contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary" id="bkmrk-gunicorn-wsgi%3Aapplic"><div class="sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">`gunicorn wsgi:application --<span class="hljs-built_in">bind</span> your-domain.com:8010`</div></div>- `wsgi:application` refers to your Masonite WSGI entry point
- `8010` is the internal port Gunicorn will listen on

---

## Step 9: Verify the Application

At this point, check if your Masonite application is running correctly.

Yes, it is working — because **you know your code better than anyone else** 🙂

If there are issues, check logs and fix them before proceeding.

---

## Step 10: Run Gunicorn in a Detached tmux Session

To keep Gunicorn running in the background, create a new tmux session:

<div class="contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary" id="bkmrk-tmux-new--s-gunicorn"><div class="sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">`tmux new -s gunicorn_session`</div></div>Run Gunicorn again inside the tmux session:

<div class="contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary" id="bkmrk-gunicorn-wsgi%3Aapplic-1"><div class="sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl/main:top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">`gunicorn wsgi:application --<span class="hljs-built_in">bind</span> your-domain.com:8010`</div></div>Detach from the session without stopping Gunicorn:

**Press:** `Ctrl + B`, then `D`

Your application will continue running in the background.

---

## Step 11: Configure Reverse Proxy in aaPanel

Now go back to **aaPanel → Website Settings → Reverse Proxy** and add a new proxy rule:

- **Target URL:** `http://127.0.0.1:8010`
- **Important:** Do **not** add a trailing slash (`/`)

Save the configuration.

---

## Step 12: Access Your Masonite Application

Open your domain in the browser.  
You will now see your **Masonite application running successfully on aaPanel**, served through Gunicorn and managed via reverse proxy.