##  [Updating Drupal modules and themes with Composer](/hc/documentation/learn-drupal/getting-started/updating-drupal-modules-and-themes-composer) 

The recommended way to install and update a Drupal 10 site is using Composer.

1. To update core, all outdated modules and theme, update the db, and clear the cache:
    
    ```plaintext
    composer update "drupal/" --with-all-dependencies
    drush updatedb
    drush cache:rebuild
    ```
2. To list updates, use Composer's built-in command:
    
    ```plaintext
    composer outdated "drupal/*"
    ```
3. To list security updates, use Drush:
    
    ```plaintext
    drush pm:security
    ```
4. To update a specific module or theme, use the following Composer command:
    
    ```plaintext
    composer update drupal/modulename --with-all-dependencies
    ```
5. For a major-version upgrade (such as 1.x to 2.x), use the following Composer command, substituting the new major version number as needed:
    
    ```plaintext
    composer require drupal/modulename:^2.0
    ```
6. After updating, run any database updates, rebuild the cache, and export the potentially changed configurations, reviewing the changes via `--diff`:
    
    ```plaintext
    drush updatedb
    drush cache:rebuild
    drush config:export --diff
    ```