Kstars
Desktop Planetarium
Install / Use
/learn @KDE/KstarsREADME
A Desktop Planetarium for KDE
KStars is free, open source, cross-platform Astronomy Software.
It provides an accurate graphical simulation of the night sky, from any location on Earth, at any date and time. The display includes up to 100 million stars, 13,000 deep-sky objects,all 8 planets, the Sun and Moon, and thousands of comets, asteroids, supernovae, and satellites.
For students and teachers, it supports adjustable simulation speeds in order to view phenomena that happen over long timescales, the KStars Astrocalculator to predict conjunctions, and many common astronomical calculations. For the amateur astronomer, it provides an observation planner, a sky calendar tool, and an FOV editor to calculate field of view of equipment and display them. Find out interesting objects in the "What's up Tonight" tool, plot altitude vs. time graphs for any object, print high-quality sky charts, and gain access to lots of information and resources to help you explore the universe!
Included with KStars is Ekos astrophotography suite, a complete astrophotography solution that can control all INDI devices including numerous telescopes, CCDs, DSLRs, focusers, filters, and a lot more. Ekos supports highly accurate tracking using online and offline astrometry solver, autofocus and autoguiding capabilities, and capture of single or multiple images using the powerful built in sequence manager.
Copyright
Copyright (c) 2001 - 2025 by The KStars Team:
KStars is Free Software, released under the GNU Public License. See COPYING for GPL license information.
Downloads
KStars is available for Windows, MacOS, and Linux. You can download the latest version from KStars official website.
Important URLs and files.
- The KStars homepage
- KStars Git Repository
- KStars Web Chat
- Forum where KStars is often discussed
KStars documentation
KStars online documentation is avaialble in several languages. It is writtetn using Restructured Text and maintain ined in the KStars Documentation Repository.
We welcome any improvements to the online documentation!
In addition, there are the following README files:
README: This file; general information README.planetmath: Explanation of algorithms used to compute planet positions README.customize: Advanced customization options README.images: Copyright information for images used in KStars. README.i18n: Instructions for translators
Development
Code can be cloned, viewed and merge requests can be made via the KStars repository. If you are new to remote git repositories, please see the Git Tips section below. Note: Previously KStars used Phabricator for its merge requests. That system is no longer in use.
Integrated Development Environment IDE
If you plan to develop KStars, it is highly recommended to utilize an Integrated Development Environment (IDE) You can use any IDE of your choice, but Visual Studio Code, Qt Creator or KDevelop are recommended as they are more suited for Qt/KDE development.
To open KStars in QtCreator, select the CMakeLists.txt file in the KStars source folder and then configure the build location and type.
Building
- Prerequisite Packages
To build and develop KStars, several packages may be required from your distribution. Here's a list.
-
Required dependencies
- GNU Make, GCC -- Essential tools for building
- cmake -- buildsystem used by KDE
- Qt Library > 5.12.0
- Several KDE Frameworks: KConfig, KGuiAddons, KWidgetsAddons, KNewStuff, KI18n, KInit, KIO, KXmlGui, KPlotting, KIconThemes
- eigen -- linear algebra library
- zlib -- compression library
- StellarSolver -- see https://github.com/rlancaste/stellarsolver
-
Optional dependencies
- libcfitsio -- FITS library
- libindi -- Instrument Neutral Distributed Interface, for controlling equipment.
- xplanet
- astrometry.net
- libraw
- wcslib
- libgsl
- libxisf
- qtkeychain
- sentry
- Installing Prerequisites
Debian/Ubuntu
The apt-add-respository command is needed for the apt-get's libstellarsolver-dev. Alternatively, you can skip the apt-add-repository, remove the libstellarsolver-dev from the apt-get, and build & install stellarsolver from https://github.com/rlancaste/stellarsolver.
sudo apt-add-repository ppa:mutlaqja/ppa
sudo apt-get -y install build-essential cmake git libstellarsolver-dev libxisf-dev libeigen3-dev libcfitsio-dev zlib1g-dev libindi-dev extra-cmake-modules libkf5plotting-dev libqt5svg5-dev libkf5xmlgui-dev libkf5kio-dev kinit-dev libkf5newstuff-dev libkf5notifications-dev qtdeclarative5-dev libkf5crash-dev gettext libnova-dev libgsl-dev libraw-dev libkf5notifyconfig-dev wcslib-dev libqt5websockets5-dev xplanet xplanet-images qt5keychain-dev libsecret-1-dev breeze-icon-theme libqt5datavisualization5-dev
Fedora
Note: the current version of stellarsolver included in fedora is QT6 based and doesn't include the QT5 libs needed for kstars. Instead build the last QT5 based version of stellarsolver after installing other dependencies.
sudo dnf install -y cfitsio-devel eigen3-devel cmake extra-cmake-modules.noarch libXISF-devel kf5-kconfig-devel kf5-kdbusaddons-devel kf5-kguiaddons-devel kf5-ki18n-devel kf5-kiconthemes-devel kf5-kinit-devel kf5-kio-devel kf5-kjobwidgets-devel kf5-knewstuff-devel kf5-kplotting-devel kf5-ktexteditor-devel kf5-kwidgetsaddons-devel kf5-kwindowsystem-devel kf5-kxmlgui-devel libindi-devel libindi-static qt5-qtdeclarative-devel qt5-qtmultimedia-devel qt5-qtdatavis3d-devel qt5-qtsvg-devel wcslib-devel xplanet zlib-devel qt5-qtwebsockets-devel kf5-kcrash-devel kf5-knotifications-devel gsl-devel libnoval-devel libcurl-devel
cd /tmp
git clone --branch 2.6 https://github.com/rlancaste/stellarsolver.git
cd stellarsolver/linux-scripts/
./installStellarSolverLibraryQt5.sh
Qt6 Support (Recommended)
We recommend using Qt6 for building KStars as we phase out Qt5 support. For optimal compatibility, we suggest using the latest Ubuntu or Arch Linux.
Arch Linux packages for Qt6:
sudo pacman -S base-devel cmake git eigen cfitsio zlib extra-cmake-modules kplotting qt6-svg kxmlgui kio knewstuff kdoctools knotifications qt6-declarative kcrash gettext libxisf libnova gsl libraw knotifyconfig wcslib qt6-websockets xplanet qtkeychain-qt6 libsecret breeze-icons qt6-quick3d curl stellarsolver
- Compiling
Open a console and run in the following commands:
mkdir -p ~/Projects/build/kstars
cd ~/Projects
git clone https://invent.kde.org/education/kstars.git
cd build/kstars
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo ~/Projects/kstars
make -j16
sudo make install
To run KStars, simply type kstars in the terminal.
Compiling with Qt6
If you are building with Qt6, you need to add the -DBUILD_WITH_QT6=ON flag to the cmake command:
mkdir -p ~/Projects/build/kstars
cd ~/Projects
git clone https://invent.kde.org/education/kstars.git
cd build/kstars
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_WITH_QT6=ON ~/Projects/kstars
make -j16
sudo make install
Code Style
KStars uses Artistic Style to format all the C++ source files. Please make sure to apply the following astyle rules to any code that is submitted to INDI. On Linux, you can create ~/.astylerc file containing the following rules:
--style=allman
--align-reference=name
--indent-switches
--indent-modifiers
--indent-classes
--pad-oper
--indent-col1-comments
--lineend=linux
--max-code-length=124
This repository also includes a matching ./.astylerc and a helper script tools/run_astyle.sh you can run from the repo root.
The pinned formatter version is stored in ./.astyle-version.
tools/run_astyle.sh uses uvx by default (to run the pinned astyle version). If uvx is not available, it falls back to astyle found in PATH.
If the available astyle version does not match ./.astyle-version, it exits with an error.
Examples:
# Format sources (changed files: pass paths, otherwise formats all tracked sources)
bash tools/run_astyle.sh
# Fail CI/local checks if formatting would change files
bash tools/run_astyle.sh --check
# Format only files changed since a ref/sha (e.g. for merge requests)
bash tools/run_astyle.sh --changed-since origin/master
Some IDEs (e.g. QtCreator) support automatic formatting for the code every time you save the file to disk.
Making Updates to the Manual
KStars online documentation is hosted The source for the handbook is in kstars/doc. You can edit those files, include them in commits and MRs like you would c++ files (see below). You could figure out the markup by example, or learn from online doc for docbook. In general, it is best to first copy the entire kstars/doc directory to a temporary directory, and edit and generate the handbook there, because if you ran meinproc in the main source directory, you would generate many .html files there, and you don't want to commit the generated files to your git repository.
cp -pr kstars/doc ~/DOCBOOK
cd ~/DOCBOOK
meinproc6 index.docbook
The above should generate html files. Then, in a browser, you can simply open DOCBOOK/index.html and navigate your way to the part you want, e.g. just type something similar to this in the url bar of chrome: file:///home/YOUR_USER_NAME/DOCBOOK/doc/tool-ekos.html Make changes to some of the .docbook files in ~/DOCBOOK/*.docb
